mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Merge branch 'checkpoint-clip' into 'master'
Can cross checkpoints when respawning and in NOCLIP state now See merge request KartKrew/Kart!2448
This commit is contained in:
commit
c3208c243a
3 changed files with 18 additions and 9 deletions
|
|
@ -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;
|
||||
|
|
|
|||
18
src/p_map.c
18
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)
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue