mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-31 22:00:46 +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)
|
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;
|
return myconnectindex;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -316,7 +316,7 @@ int findplayer(const spritetype* s, int* d)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
*d = closest;
|
if (d) *d = closest;
|
||||||
return closest_player;
|
return closest_player;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue