diff --git a/src/p_mobj.c b/src/p_mobj.c index 1f2e5e3de..7533e8fc5 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -11006,7 +11006,7 @@ void P_SpawnPrecipitation(void) { INT32 i, j, k; 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; subsector_t *precipsector = NULL; precipmobj_t *rainmo = NULL; @@ -11053,7 +11053,7 @@ void P_SpawnPrecipitation(void) { rainmo = P_SpawnPrecipMobj(x, y, z, type); - if (randomstates > 0 && randomstates < UINT8_MAX) + if (randomstates > 0) { UINT8 mrand = M_RandomByte(); UINT8 threshold = UINT8_MAX / (randomstates + 1); diff --git a/src/p_spec.c b/src/p_spec.c index 1cca2cd5e..953503f9d 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -2041,7 +2041,7 @@ void P_SwitchWeather(UINT8 newWeather) } 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; precipmobj_t *precipmobj; statenum_t st; @@ -2057,7 +2057,7 @@ void P_SwitchWeather(UINT8 newWeather) st = mobjinfo[swap].spawnstate; - if (randomstates > 0 && randomstates < UINT8_MAX) + if (randomstates > 0) { UINT8 mrand = M_RandomByte(); UINT8 threshold = UINT8_MAX / (randomstates + 1);