Fix a warning

This commit is contained in:
Sryder 2017-03-09 22:28:56 +00:00
parent ebd777fe8b
commit 546b98b4cb

View file

@ -7405,13 +7405,14 @@ void P_MobjThinker(mobj_t *mobj)
break; break;
case MT_REDITEM: case MT_REDITEM:
{ {
fixed_t magnitude;
if (mobj->threshold > 0) if (mobj->threshold > 0)
mobj->threshold--; mobj->threshold--;
if (leveltime % 7 == 0) if (leveltime % 7 == 0)
S_StartSound(mobj, mobj->info->activesound); S_StartSound(mobj, mobj->info->activesound);
// Do a similar thing to what is done to the player to keep the red shell at a speed cap // Do a similar thing to what is done to the player to keep the red shell at a speed cap
fixed_t magnitude = P_AproxDistance(mobj->momx, mobj->momy); magnitude = P_AproxDistance(mobj->momx, mobj->momy);
if (magnitude > 64*FRACUNIT) if (magnitude > 64*FRACUNIT)
{ {
mobj->momx = FixedMul(FixedDiv(mobj->momx, magnitude), 64*FRACUNIT); mobj->momx = FixedMul(FixedDiv(mobj->momx, magnitude), 64*FRACUNIT);