Skip to content

Commit

Permalink
SPECTATOR: track players across map change
Browse files Browse the repository at this point in the history
  • Loading branch information
dusty-qw committed Aug 4, 2024
1 parent a4c8848 commit d9199e4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/spectate.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ qbool SpecCanConnect(gedict_t *spec)
///////////////
void SpectatorConnect()
{
gedict_t *p;
gedict_t *p, *id;
int diff = (int)(PROG_TO_EDICT(self->s.v.goalentity) - world);

// we need this before the SpecCanConnect() call, as we need to restore admin and/or coach flags
Expand Down Expand Up @@ -199,6 +199,12 @@ void SpectatorConnect()
self->wizard->s.v.nextthink = g_globalvars.time + 0.1;
}

// resume tracking player from before map change
if ((id = PROG_TO_EDICT(self->s.v.goalentity)) != world)
{
stuffcmd_flags(self, STUFFCMD_IGNOREINDEMO, "track %d\n", NUM_FOR_EDICT(id));
}

// Wait until you do stuffing
MakeMOTD();
}
Expand Down

0 comments on commit d9199e4

Please sign in to comment.