mirror of
https://github.com/yquake2/xatrix.git
synced 2024-11-10 06:42:22 +00:00
Prevent potential division by zero
This commit is contained in:
parent
3e063fe549
commit
ad3fe0b674
1 changed files with 1 additions and 1 deletions
|
@ -123,7 +123,7 @@ void DoRespawn (edict_t *ent)
|
|||
for (count = 0, ent = master; ent; ent = ent->chain, count++)
|
||||
;
|
||||
|
||||
choice = rand() % count;
|
||||
choice = count ? randk() % count : 0;
|
||||
|
||||
for (count = 0, ent = master; count < choice; ent = ent->chain, count++)
|
||||
;
|
||||
|
|
Loading…
Reference in a new issue