mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-27 04:21:47 +00:00
Fix respawns in antigrav
This commit is contained in:
parent
56da04bdec
commit
b8f2fe4bcc
1 changed files with 14 additions and 5 deletions
|
|
@ -34,13 +34,22 @@ fixed_t K_RespawnOffset(player_t *player, boolean flip)
|
||||||
|
|
||||||
if (flip == true)
|
if (flip == true)
|
||||||
{
|
{
|
||||||
player->mo->flags2 |= MF2_OBJECTFLIP;
|
// Lat 24/7/20: Okay so before we even think about applying this flag, check if the sector we're in doesn't already have reverse gravity for that.
|
||||||
|
// Otherwise, we would reverse the reverse gravity and cancel it out. Yes, this is absolutely fucking dumb.
|
||||||
|
// I'm honestly not sure if this flag is even necessary anymore but we'll keep it just in case.
|
||||||
|
|
||||||
|
if (P_GetMobjGravity(player->mo) < 0)
|
||||||
|
player->mo->flags2 |= MF2_OBJECTFLIP;
|
||||||
|
|
||||||
player->mo->eflags |= MFE_VERTICALFLIP;
|
player->mo->eflags |= MFE_VERTICALFLIP;
|
||||||
z -= (128 * mapobjectscale) - (player->mo->height);
|
z -= ((128 * mapobjectscale) + (player->mo->height));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
player->mo->flags2 &= ~MF2_OBJECTFLIP;
|
|
||||||
|
if (P_GetMobjGravity(player->mo) > 0)
|
||||||
|
player->mo->flags2 &= ~MF2_OBJECTFLIP; // See comment above, ditto.
|
||||||
|
|
||||||
player->mo->eflags &= ~MFE_VERTICALFLIP;
|
player->mo->eflags &= ~MFE_VERTICALFLIP;
|
||||||
z += (128 * mapobjectscale);
|
z += (128 * mapobjectscale);
|
||||||
}
|
}
|
||||||
|
|
@ -75,7 +84,7 @@ static void K_RespawnAtWaypoint(player_t *player, waypoint_t *waypoint)
|
||||||
player->respawn.pointx = waypoint->mobj->x;
|
player->respawn.pointx = waypoint->mobj->x;
|
||||||
player->respawn.pointy = waypoint->mobj->y;
|
player->respawn.pointy = waypoint->mobj->y;
|
||||||
player->respawn.pointz = waypoint->mobj->z;
|
player->respawn.pointz = waypoint->mobj->z;
|
||||||
player->respawn.flip = (waypoint->mobj->flags2 & MF2_OBJECTFLIP);
|
player->respawn.flip = (waypoint->mobj->flags2 & MF2_OBJECTFLIP) ? true : false; // K_RespawnOffset wants a boolean!
|
||||||
player->respawn.pointz += K_RespawnOffset(player, player->respawn.flip);
|
player->respawn.pointz += K_RespawnOffset(player, player->respawn.flip);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue