Prevent overflow when attempting to calculate the space between floor and ceiling. (I didn't notice any bugs as a result of the previous behvaiour, but you never know.)

This commit is contained in:
toasterbabe 2016-09-22 12:01:13 +01:00
parent fa16abf7ae
commit 0568712a5e
1 changed files with 2 additions and 2 deletions

View File

@ -994,7 +994,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
if (tmthing->player && tmthing->z + tmthing->height > topz if (tmthing->player && tmthing->z + tmthing->height > topz
&& tmthing->z + tmthing->height < tmthing->ceilingz) && tmthing->z + tmthing->height < tmthing->ceilingz)
{ {
tmceilingz = INT32_MIN; // block while in air tmfloorz = tmceilingz = INT32_MIN; // block while in air
#ifdef ESLOPE #ifdef ESLOPE
tmceilingslope = NULL; tmceilingslope = NULL;
#endif #endif
@ -1037,7 +1037,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
if (tmthing->player && tmthing->z < topz if (tmthing->player && tmthing->z < topz
&& tmthing->z > tmthing->floorz) && tmthing->z > tmthing->floorz)
{ {
tmfloorz = INT32_MAX; // block while in air tmfloorz = tmceilingz = INT32_MAX; // block while in air
#ifdef ESLOPE #ifdef ESLOPE
tmfloorslope = NULL; tmfloorslope = NULL;
#endif #endif