diff --git a/src/p_map.c b/src/p_map.c index 6cc3b5ac0..c9342a74f 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -2932,6 +2932,8 @@ static boolean P_ThingHeightClip(mobj_t *thing) ffloor_t *oldceilingrover = thing->ceilingrover; boolean onfloor = P_IsObjectOnGround(thing);//(thing->z <= thing->floorz); ffloor_t *rover = NULL; + boolean bouncing; + boolean hitfloor; if (thing->flags & MF_NOCLIPHEIGHT) return true; @@ -2954,7 +2956,9 @@ static boolean P_ThingHeightClip(mobj_t *thing) if (tmfloorz > oldfloorz+thing->height) return true; - if (onfloor && !(thing->flags & MF_NOGRAVITY) && floormoved) + bouncing = thing->player && thing->state-states == S_PLAY_BOUNCE_LANDING && P_IsObjectOnGround(thing); + + if ((onfloor || bouncing) && !(thing->flags & MF_NOGRAVITY) && floormoved) { rover = (thing->eflags & MFE_VERTICALFLIP) ? oldceilingrover : oldfloorrover; @@ -2962,6 +2966,7 @@ static boolean P_ThingHeightClip(mobj_t *thing) // If ~FF_EXISTS, don't set mobj Z. if (!rover || ((rover->flags & FF_EXISTS) && (rover->flags & FF_SOLID))) { + hitfloor = bouncing; if (thing->eflags & MFE_VERTICALFLIP) thing->pmomz = thing->ceilingz - (thing->z + thing->height); else @@ -2986,7 +2991,7 @@ static boolean P_ThingHeightClip(mobj_t *thing) thing->z = thing->ceilingz - thing->height; } - if (P_MobjFlip(thing)*(thing->z - oldz) > 0 && thing->player) + if ((P_MobjFlip(thing)*(thing->z - oldz) > 0 || hitfloor) && thing->player) P_PlayerHitFloor(thing->player, !onfloor); // debug: be sure it falls to the floor diff --git a/src/p_user.c b/src/p_user.c index 98542ad17..20292dd08 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -2319,6 +2319,8 @@ boolean P_PlayerHitFloor(player_t *player, boolean dorollstuff) if (player->scoreadd) player->scoreadd--; } + else + player->mo->z += P_MobjFlip(player->mo); clipmomz = false; } else @@ -8414,7 +8416,7 @@ static void P_MovePlayer(player_t *player) // Also keep in mind the PF_JUMPED check. // If we lacked this, stepping up while jumping up would reset score. // (for instance, when climbing up off a wall.) - if ((onground || player->climbing) && !(player->pflags & (PF_JUMPED|PF_BOUNCING)) && player->powers[pw_invulnerability] <= 1) + if ((onground || player->climbing) && !(player->pflags & PF_JUMPED) && player->powers[pw_invulnerability] <= 1) P_ResetScore(player); // Show the "THOK!" graphic when spinning quickly across the ground. (even applies to non-spinners, in the case of zoom tubes)