Readability changes

This commit is contained in:
lachwright 2019-10-07 13:35:10 +08:00
parent 7850d43725
commit 306779fac0

View file

@ -963,9 +963,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
P_DamageMobj(thing, tmthing, tmthing, 1, 0);
}
if (thing->type == MT_ROLLOUTROCK)
{
if (tmthing->player)
if (thing->type == MT_ROLLOUTROCK && tmthing->player)
{
if (tmthing->player->powers[pw_carry] == CR_ROLLOUT)
{
@ -988,18 +986,6 @@ static boolean PIT_CheckThing(mobj_t *thing)
return true;
}
}
else if (tmthing->type == thing->type)
{
if (tmthing->z > thing->z + thing->height || thing->z > tmthing->z + tmthing->height)
return true;
fixed_t tempmomx = thing->momx, tempmomy = thing->momy;
thing->momx = tmthing->momx;
thing->momy = tmthing->momy;
tmthing->momx = tempmomx;
tmthing->momy = tempmomy;
}
}
else if (tmthing->type == MT_ROLLOUTROCK)
{
if (tmthing->z > thing->z + thing->height || thing->z > tmthing->z + tmthing->height || !thing->health)
@ -1008,6 +994,15 @@ static boolean PIT_CheckThing(mobj_t *thing)
if (thing == tmthing->target)
return true;
if (thing->type == tmthing->type)
{
fixed_t tempmomx = thing->momx, tempmomy = thing->momy;
thing->momx = tmthing->momx;
thing->momy = tmthing->momy;
tmthing->momx = tempmomx;
tmthing->momy = tempmomy;
}
if (thing->flags & MF_SPRING)
{
P_DoSpring(thing, tmthing);