center camera when joining from spec

the camera never gets centered proper if you join from spectator
This commit is contained in:
Alug 2023-11-21 15:24:32 +01:00
parent 62294dfe35
commit e2605ff16c

View file

@ -8055,6 +8055,10 @@ boolean P_SpectatorJoinGame(player_t *player)
player->ctfteam = changeto; player->ctfteam = changeto;
player->playerstate = PST_REBORN; player->playerstate = PST_REBORN;
//center camera if its not already
if ((P_IsLocalPlayer(player)) && localaiming[0] != 0)
localaiming[0] = 0;
//Reset away view //Reset away view
if (P_IsLocalPlayer(player) && displayplayers[0] != consoleplayer) if (P_IsLocalPlayer(player) && displayplayers[0] != consoleplayer)
displayplayers[0] = consoleplayer; displayplayers[0] = consoleplayer;
@ -8079,6 +8083,9 @@ boolean P_SpectatorJoinGame(player_t *player)
player->kartstuff[k_spectatewait] = 0; player->kartstuff[k_spectatewait] = 0;
player->playerstate = PST_REBORN; player->playerstate = PST_REBORN;
//center camera if its not already
if ((P_IsLocalPlayer(player)) && localaiming[0] != 0)
//Reset away view //Reset away view
if (P_IsLocalPlayer(player) && displayplayers[0] != consoleplayer) if (P_IsLocalPlayer(player) && displayplayers[0] != consoleplayer)
displayplayers[0] = consoleplayer; displayplayers[0] = consoleplayer;