mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Fix spectators spawning at 0, 0 when joining mid game
This commit is contained in:
parent
88bbe8875d
commit
20bfbca029
2 changed files with 12 additions and 1 deletions
|
|
@ -2562,7 +2562,9 @@ void G_MovePlayerToSpawnOrStarpost(INT32 playernum)
|
||||||
else
|
else
|
||||||
P_MovePlayerToStarpost(playernum);
|
P_MovePlayerToStarpost(playernum);
|
||||||
#else
|
#else
|
||||||
if (leveltime > starttime)
|
// Player's first spawn should be at the "map start".
|
||||||
|
// I.e. level load or join mid game.
|
||||||
|
if (leveltime > starttime && players[playernum].jointime > 0)
|
||||||
P_MovePlayerToStarpost(playernum);
|
P_MovePlayerToStarpost(playernum);
|
||||||
else
|
else
|
||||||
P_MovePlayerToSpawn(playernum, G_FindMapStart(playernum));
|
P_MovePlayerToSpawn(playernum, G_FindMapStart(playernum));
|
||||||
|
|
|
||||||
|
|
@ -11556,6 +11556,15 @@ void P_MovePlayerToSpawn(INT32 playernum, mapthing_t *mthing)
|
||||||
{
|
{
|
||||||
K_DoIngameRespawn(p);
|
K_DoIngameRespawn(p);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// This is important for spectators. If you are
|
||||||
|
// a spectator now, then when you enter the game,
|
||||||
|
// respawn back at this point.
|
||||||
|
p->respawn.pointx = x;
|
||||||
|
p->respawn.pointy = y;
|
||||||
|
p->respawn.pointz = z;
|
||||||
|
}
|
||||||
|
|
||||||
P_AfterPlayerSpawn(playernum);
|
P_AfterPlayerSpawn(playernum);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue