mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2025-01-28 20:20:43 +00:00
broken spectator stuff?
This commit is contained in:
parent
26770c5103
commit
3cec3d9658
2 changed files with 15 additions and 5 deletions
16
src/g_game.c
16
src/g_game.c
|
@ -4483,6 +4483,8 @@ char *G_BuildMapTitle(INT32 mapnum)
|
||||||
#define DF_ATTACKSHIFT 1
|
#define DF_ATTACKSHIFT 1
|
||||||
#define DF_MULTIPLAYER 0x80 // This demo contains a dynamic number of players!
|
#define DF_MULTIPLAYER 0x80 // This demo contains a dynamic number of players!
|
||||||
|
|
||||||
|
#define DEMO_SPECTATOR 0x40
|
||||||
|
|
||||||
// For demos
|
// For demos
|
||||||
#define ZT_FWD 0x01
|
#define ZT_FWD 0x01
|
||||||
#define ZT_SIDE 0x02
|
#define ZT_SIDE 0x02
|
||||||
|
@ -5498,10 +5500,10 @@ void G_BeginRecording(void)
|
||||||
|
|
||||||
// Now store a SIMPLIFIED data struct for each in-game player
|
// Now store a SIMPLIFIED data struct for each in-game player
|
||||||
for (p = 0; p < MAXPLAYERS; p++) {
|
for (p = 0; p < MAXPLAYERS; p++) {
|
||||||
if (playeringame[p] && !players[p].spectator) {
|
if (playeringame[p]) {
|
||||||
player = &players[p];
|
player = &players[p];
|
||||||
|
|
||||||
WRITEUINT8(demo_p, p);
|
WRITEUINT8(demo_p, p | (player->spectator ? DEMO_SPECTATOR : 0));
|
||||||
|
|
||||||
// Name
|
// Name
|
||||||
memset(name, 0, 16);
|
memset(name, 0, 16);
|
||||||
|
@ -5991,15 +5993,23 @@ void G_DoPlayDemo(char *defdemoname)
|
||||||
|
|
||||||
if (multiplayer) {
|
if (multiplayer) {
|
||||||
player_t *player;
|
player_t *player;
|
||||||
|
boolean spectator;
|
||||||
|
|
||||||
// Load players that were in-game when the map started
|
// Load players that were in-game when the map started
|
||||||
p = READUINT8(demo_p);
|
p = READUINT8(demo_p);
|
||||||
|
|
||||||
while (p != 0xFF)
|
while (p != 0xFF)
|
||||||
{
|
{
|
||||||
if (!playeringame[displayplayer])
|
spectator = false;
|
||||||
|
if (p & DEMO_SPECTATOR) {
|
||||||
|
spectator = true;
|
||||||
|
p &= ~DEMO_SPECTATOR;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!playeringame[displayplayer] || players[displayplayer].spectator)
|
||||||
displayplayer = consoleplayer = p;
|
displayplayer = consoleplayer = p;
|
||||||
playeringame[p] = true;
|
playeringame[p] = true;
|
||||||
|
players[p].spectator = spectator;
|
||||||
|
|
||||||
// Name
|
// Name
|
||||||
M_Memcpy(player_names[p],demo_p,16);
|
M_Memcpy(player_names[p],demo_p,16);
|
||||||
|
|
|
@ -604,7 +604,7 @@ void P_Ticker(boolean run)
|
||||||
G_WriteDemoTiccmd(&players[consoleplayer].cmd, 0);
|
G_WriteDemoTiccmd(&players[consoleplayer].cmd, 0);
|
||||||
} else {
|
} else {
|
||||||
for (i = 0; i < MAXPLAYERS; i++)
|
for (i = 0; i < MAXPLAYERS; i++)
|
||||||
if (playeringame[i] && !players[i].spectator)
|
if (playeringame[i])
|
||||||
G_WriteDemoTiccmd(&players[i].cmd, i);
|
G_WriteDemoTiccmd(&players[i].cmd, i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -615,7 +615,7 @@ void P_Ticker(boolean run)
|
||||||
G_ReadDemoTiccmd(&players[consoleplayer].cmd, 0);
|
G_ReadDemoTiccmd(&players[consoleplayer].cmd, 0);
|
||||||
} else {
|
} else {
|
||||||
for (i = 0; i < MAXPLAYERS; i++)
|
for (i = 0; i < MAXPLAYERS; i++)
|
||||||
if (playeringame[i] && !players[i].spectator)
|
if (playeringame[i])
|
||||||
G_ReadDemoTiccmd(&players[i].cmd, i);
|
G_ReadDemoTiccmd(&players[i].cmd, i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue