diff --git a/src/m_cheat.c b/src/m_cheat.c index ae2703ee2..bb757839a 100644 --- a/src/m_cheat.c +++ b/src/m_cheat.c @@ -833,7 +833,10 @@ void Command_Savecheckpoint_f(void) players[consoleplayer].starpostangle = players[consoleplayer].mo->angle; players[consoleplayer].starpostscale = players[consoleplayer].mo->destscale; if (players[consoleplayer].mo->flags2 & MF2_OBJECTFLIP) + { players[consoleplayer].starpostscale *= -1; + players[consoleplayer].starpostz += players[consoleplayer].mo->height; + } CONS_Printf(M_GetText("Temporary checkpoint created at %d, %d, %d\n"), players[consoleplayer].starpostx, players[consoleplayer].starposty, players[consoleplayer].starpostz); } diff --git a/src/p_inter.c b/src/p_inter.c index 53481d6c5..cc9250e42 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -1431,7 +1431,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) if (special->flags2 & MF2_OBJECTFLIP) { players[i].starpostscale *= -1; - players[i].starpostz += (special->height - P_GetPlayerHeight(player))>>FRACBITS; + players[i].starpostz += special->height>>FRACBITS; } players[i].starpostnum = special->health; @@ -1453,7 +1453,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) if (special->flags2 & MF2_OBJECTFLIP) { player->starpostscale *= -1; - player->starpostz += (special->height - P_GetPlayerHeight(player))>>FRACBITS; + player->starpostz += special->height>>FRACBITS; } player->starpostnum = special->health; S_StartSound(toucher, special->info->painsound); diff --git a/src/p_mobj.c b/src/p_mobj.c index 130808712..5843b9f43 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -10669,24 +10669,26 @@ void P_MovePlayerToStarpost(INT32 playernum) P_SetScale(mobj, (mobj->destscale = abs(p->starpostscale))); - mobj->floorz = floor; - mobj->ceilingz = ceiling; - - if (z <= floor) - z = floor; - else if (z >= ceiling - mobj->height) - z = ceiling - mobj->height; - - mobj->z = z; - if (p->starpostscale < 0) { mobj->flags2 |= MF2_OBJECTFLIP; - if (mobj->z + mobj->height == mobj->ceilingz) + if (z >= ceiling) + { mobj->eflags |= MFE_ONGROUND; + z = ceiling; + } + z -= mobj->height; } - else if (mobj->z == mobj->floorz) + else if (z <= floor) + { mobj->eflags |= MFE_ONGROUND; + z = floor; + } + + mobj->floorz = floor; + mobj->ceilingz = ceiling; + + mobj->z = z; mobj->angle = p->starpostangle;