denom of A_CheckRandom can't be zero, that would be bad

This commit is contained in:
Inuyasha 2016-03-30 06:20:57 -07:00
parent caf081b6f5
commit 9cec9093bb
1 changed files with 3 additions and 0 deletions

View File

@ -8528,6 +8528,9 @@ void A_CheckRandom(mobj_t *actor)
if (LUA_CallAction("A_CheckRandom", actor))
return;
#endif
if ((locvar1 & 0xFFFF) == 0)
return;
// The PRNG doesn't suck anymore, OK?
if (locvar1 >> 16)
chance *= (locvar1 >> 16);