diff --git a/src/k_respawn.c b/src/k_respawn.c index e3854ea9c..e319a7d3a 100644 --- a/src/k_respawn.c +++ b/src/k_respawn.c @@ -446,6 +446,9 @@ static void K_MovePlayerToRespawnPoint(player_t *player) // Reduce by the amount we needed to get to this waypoint stepamt -= dist; + fixed_t oldx = player->mo->x; + fixed_t oldy = player->mo->y = dest.y; + // We've reached the destination point, P_UnsetThingPosition(player->mo); player->mo->x = dest.x; @@ -453,6 +456,9 @@ static void K_MovePlayerToRespawnPoint(player_t *player) player->mo->z = dest.z; P_SetThingPosition(player->mo); + // Did we cross a checkpoint during our last step? + Obj_CrossCheckpoints(player, oldx, oldy); + // We are no longer traveling from death location to 1st waypoint, so use standard timings if (player->respawn.fast) player->respawn.fast = false; diff --git a/src/p_map.c b/src/p_map.c index f8be8b6f9..bc91b61a6 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -3175,16 +3175,16 @@ boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff, Try thing->player->pflags |= PF_FREEZEWAYPOINTS; } } + } - // Currently this just iterates all checkpoints. - // Pretty shitty way to do it, but only players can - // cross it, so it's good enough. Works as long as the - // move doesn't cross multiple -- it can only evaluate - // one. - if (thing->player) - { - Obj_CrossCheckpoints(thing->player, oldx, oldy); - } + // Currently this just iterates all checkpoints. + // Pretty shitty way to do it, but only players can + // cross it, so it's good enough. Works as long as the + // move doesn't cross multiple -- it can only evaluate + // one. + if (thing->player) + { + Obj_CrossCheckpoints(thing->player, oldx, oldy); } if (result != NULL) diff --git a/src/p_mobj.c b/src/p_mobj.c index 11a650ea4..785f9f6a1 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -4010,12 +4010,15 @@ static void P_PlayerMobjThinker(mobj_t *mobj) || mobj->player->loop.radius != 0) { P_HitSpecialLines(mobj, mobj->x, mobj->y, mobj->momx, mobj->momy); + fixed_t oldx = mobj->x; + fixed_t oldy = mobj->y; P_UnsetThingPosition(mobj); mobj->x += mobj->momx; mobj->y += mobj->momy; mobj->z += mobj->momz; P_SetThingPosition(mobj); P_CheckPosition(mobj, mobj->x, mobj->y, NULL); + Obj_CrossCheckpoints(mobj->player, oldx, oldy); // I would put this inside P_HitSpecialLines, but its wants a player reference with post-move coords instead of and old and new mobj->floorz = g_tm.floorz; mobj->ceilingz = g_tm.ceilingz; mobj->terrain = NULL;