add speccam playerflag

the other thing was weird and dumb lol
This commit is contained in:
Alug committed 2025-01-02 06:49:47 +01:00
1 parent 574ff2cb84
commit 6024405de4
3 files changed
+12 -6

No files matched your search

+2
View File
@@ -538,6 +538,8 @@ typedef struct player_s
INT32 awayviewtics;
angle_t awayviewaiming; // Used for cut-away view
boolean speccam;
boolean spectator;
UINT8 bot;
+6
View File
@@ -10705,7 +10705,10 @@ void P_SpawnPlayer(INT32 playernum)
if (multiplayer && demo.playback)
; // Don't mess with spectator values since the demo setup handles them already.
else if (!G_GametypeHasSpectators())
{
p->spectator = false;
p->speccam = false;
}
else if (netgame && p->jointime <= 1 && pcount)
{
p->spectator = true;
@@ -10737,7 +10740,10 @@ void P_SpawnPlayer(INT32 playernum)
SendNetXCmd(XD_TEAMCHANGE, &usvalue, sizeof(usvalue));
}
else // Otherwise, never spectator.
{
p->spectator = false;
p->speccam = false;
}
}
if (G_GametypeHasTeams())
+4 -6
View File
@@ -63,8 +63,6 @@
static boolean onground;
static boolean speccam = false;
//
// P_Thrust
// Moves the given origin along a given angle.
@@ -2275,12 +2273,10 @@ static void P_MovePlayer(player_t *player)
if (player->spectator)
{
player->speccam = true;
P_SpectatorMovement(player);
speccam = true;
return;
}
else
speccam = false;
//////////////////////
// MOVEMENT CODE //
@@ -3522,7 +3518,7 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
num = 0;
}
if (thiscam->freecam || (player->spectator && speccam == true))
if (thiscam->freecam || (player->spectator && player->speccam == true))
{
P_DemoCameraMovement(thiscam, num);
return true;
@@ -4094,6 +4090,7 @@ boolean P_SpectatorJoinGame(player_t *player)
player->mo = NULL;
}
player->spectator = false;
player->speccam = false;
player->pflags &= ~PF_WANTSTOJOIN;
player->kartstuff[k_spectatewait] = 0;
player->ctfteam = changeto;
@@ -4122,6 +4119,7 @@ boolean P_SpectatorJoinGame(player_t *player)
player->mo = NULL;
}
player->spectator = false;
player->speccam = false;
player->pflags &= ~PF_WANTSTOJOIN;
player->kartstuff[k_spectatewait] = 0;
player->playerstate = PST_REBORN;