mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-14 08:30:49 +00:00
Merge branch 'master' of https://github.com/Edward850/zdoom
This commit is contained in:
commit
584dd78ba9
1 changed files with 13 additions and 12 deletions
|
@ -1542,7 +1542,6 @@ bool P_LookForEnemies (AActor *actor, INTBOOL allaround, FLookExParams *params)
|
||||||
bool P_LookForPlayers (AActor *actor, INTBOOL allaround, FLookExParams *params)
|
bool P_LookForPlayers (AActor *actor, INTBOOL allaround, FLookExParams *params)
|
||||||
{
|
{
|
||||||
int c;
|
int c;
|
||||||
int stop;
|
|
||||||
int pnum;
|
int pnum;
|
||||||
player_t* player;
|
player_t* player;
|
||||||
bool chasegoal = params? (!(params->flags & LOF_DONTCHASEGOAL)) : true;
|
bool chasegoal = params? (!(params->flags & LOF_DONTCHASEGOAL)) : true;
|
||||||
|
@ -1615,9 +1614,11 @@ bool P_LookForPlayers (AActor *actor, INTBOOL allaround, FLookExParams *params)
|
||||||
{
|
{
|
||||||
pnum = actor->LastLookPlayerNumber;
|
pnum = actor->LastLookPlayerNumber;
|
||||||
}
|
}
|
||||||
stop = (pnum - 1) & (MAXPLAYERS-1);
|
|
||||||
|
|
||||||
for (;;)
|
for (;;)
|
||||||
|
{
|
||||||
|
// [ED850] Each and every player should only ever be checked once.
|
||||||
|
if (c++ < MAXPLAYERS)
|
||||||
{
|
{
|
||||||
pnum = (pnum + 1) & (MAXPLAYERS - 1);
|
pnum = (pnum + 1) & (MAXPLAYERS - 1);
|
||||||
if (!playeringame[pnum])
|
if (!playeringame[pnum])
|
||||||
|
@ -1627,8 +1628,8 @@ bool P_LookForPlayers (AActor *actor, INTBOOL allaround, FLookExParams *params)
|
||||||
{
|
{
|
||||||
actor->LastLookPlayerNumber = pnum;
|
actor->LastLookPlayerNumber = pnum;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (++c == MAXPLAYERS-1 || pnum == stop)
|
else
|
||||||
{
|
{
|
||||||
// done looking
|
// done looking
|
||||||
if (actor->target == NULL)
|
if (actor->target == NULL)
|
||||||
|
@ -1692,11 +1693,11 @@ bool P_LookForPlayers (AActor *actor, INTBOOL allaround, FLookExParams *params)
|
||||||
&& P_AproxDistance (player->mo->velx, player->mo->vely)
|
&& P_AproxDistance (player->mo->velx, player->mo->vely)
|
||||||
< 5*FRACUNIT)
|
< 5*FRACUNIT)
|
||||||
{ // Player is sneaking - can't detect
|
{ // Player is sneaking - can't detect
|
||||||
return false;
|
continue;
|
||||||
}
|
}
|
||||||
if (pr_lookforplayers() < 225)
|
if (pr_lookforplayers() < 225)
|
||||||
{ // Player isn't sneaking, but still didn't detect
|
{ // Player isn't sneaking, but still didn't detect
|
||||||
return false;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue