Fix unsigned/signed comparison

This commit is contained in:
Sally Cochenour 2020-03-03 17:05:04 -05:00
parent 0c1d0d8f5c
commit ff190b7a88
2 changed files with 4 additions and 4 deletions

View file

@ -11006,7 +11006,7 @@ void P_SpawnPrecipitation(void)
{ {
INT32 i, j, k; INT32 i, j, k;
mobjtype_t type = precipprops[curWeather].type; mobjtype_t type = precipprops[curWeather].type;
INT32 randomstates = mobjinfo[type].damage; UINT8 randomstates = (UINT8)mobjinfo[type].damage;
fixed_t basex, basey, x, y, z, height; fixed_t basex, basey, x, y, z, height;
subsector_t *precipsector = NULL; subsector_t *precipsector = NULL;
precipmobj_t *rainmo = NULL; precipmobj_t *rainmo = NULL;
@ -11053,7 +11053,7 @@ void P_SpawnPrecipitation(void)
{ {
rainmo = P_SpawnPrecipMobj(x, y, z, type); rainmo = P_SpawnPrecipMobj(x, y, z, type);
if (randomstates > 0 && randomstates < UINT8_MAX) if (randomstates > 0)
{ {
UINT8 mrand = M_RandomByte(); UINT8 mrand = M_RandomByte();
UINT8 threshold = UINT8_MAX / (randomstates + 1); UINT8 threshold = UINT8_MAX / (randomstates + 1);

View file

@ -2041,7 +2041,7 @@ void P_SwitchWeather(UINT8 newWeather)
} }
else if (swap != MT_NULL) // Rather than respawn all that crap, reuse it! else if (swap != MT_NULL) // Rather than respawn all that crap, reuse it!
{ {
INT32 randomstates = mobjinfo[swap].damage; UINT8 randomstates = (UINT8)mobjinfo[swap].damage;
thinker_t *think; thinker_t *think;
precipmobj_t *precipmobj; precipmobj_t *precipmobj;
statenum_t st; statenum_t st;
@ -2057,7 +2057,7 @@ void P_SwitchWeather(UINT8 newWeather)
st = mobjinfo[swap].spawnstate; st = mobjinfo[swap].spawnstate;
if (randomstates > 0 && randomstates < UINT8_MAX) if (randomstates > 0)
{ {
UINT8 mrand = M_RandomByte(); UINT8 mrand = M_RandomByte();
UINT8 threshold = UINT8_MAX / (randomstates + 1); UINT8 threshold = UINT8_MAX / (randomstates + 1);