From bed9dff077637f2ed5881a26f7b481f252ae45e0 Mon Sep 17 00:00:00 2001 From: lachwright <lachlanwright17@gmail.com> Date: Mon, 7 Oct 2019 13:36:36 +0800 Subject: [PATCH] Readability changes --- src/p_map.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/p_map.c b/src/p_map.c index 380f85ac3a..734def2021 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -976,7 +976,7 @@ static boolean PIT_CheckThing(mobj_t *thing) && ((!(tmthing->eflags & MFE_VERTICALFLIP) && abs(thing->z + thing->height - tmthing->z) < (thing->height>>2)) || (tmthing->eflags & MFE_VERTICALFLIP && abs(tmthing->z + tmthing->height - thing->z) < (thing->height>>2)))) { - thing->flags &= ~MF_PUSHABLE; + thing->flags &= ~MF_PUSHABLE; // prevent riding player from applying pushable movement logic P_SetTarget(&thing->target, tmthing); P_ResetPlayer(tmthing->player); P_SetPlayerMobjState(tmthing, S_PLAY_WALK); @@ -991,28 +991,28 @@ static boolean PIT_CheckThing(mobj_t *thing) if (tmthing->z > thing->z + thing->height || thing->z > tmthing->z + tmthing->height || !thing->health) return true; - if (thing == tmthing->target) + if (thing == tmthing->target) // don't collide with rider 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) + if (thing->flags & MF_SPRING) // bounce on springs { P_DoSpring(thing, tmthing); return true; } - else if (thing->flags & MF_MONITOR && thing->flags & MF_SHOOTABLE && !(tmthing->flags & MF_PUSHABLE)) // carrying a player + else if (thing->flags & (MF_MONITOR|MF_SHOOTABLE) == (MF_MONITOR|MF_SHOOTABLE) && !(tmthing->flags & MF_PUSHABLE)) // pop monitors while carrying a player { P_KillMobj(thing, tmthing, tmthing->target, 0); return true; } + + if (thing->type == tmthing->type) // bounce against other rollout rocks + { + fixed_t tempmomx = thing->momx, tempmomy = thing->momy; + thing->momx = tmthing->momx; + thing->momy = tmthing->momy; + tmthing->momx = tempmomx; + tmthing->momy = tempmomy; + } } if (thing->type == MT_PTERABYTE && tmthing->player) -- GitLab