mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-29 04:50:42 +00:00
- added null check to findplayer.
This commit is contained in:
parent
577a800843
commit
4c47361132
1 changed files with 2 additions and 2 deletions
|
@ -299,7 +299,7 @@ int findplayer(const spritetype* s, int* d)
|
|||
|
||||
if (ud.multimode < 2)
|
||||
{
|
||||
*d = abs(ps[myconnectindex].oposx - s->x) + abs(ps[myconnectindex].oposy - s->y) + ((abs(ps[myconnectindex].oposz - s->z + (28 << 8))) >> 4);
|
||||
if (d) *d = abs(ps[myconnectindex].oposx - s->x) + abs(ps[myconnectindex].oposy - s->y) + ((abs(ps[myconnectindex].oposz - s->z + (28 << 8))) >> 4);
|
||||
return myconnectindex;
|
||||
}
|
||||
|
||||
|
@ -316,7 +316,7 @@ int findplayer(const spritetype* s, int* d)
|
|||
}
|
||||
}
|
||||
|
||||
*d = closest;
|
||||
if (d) *d = closest;
|
||||
return closest_player;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue