Skip to content
Permalink
Browse files

game: fixed logged out shoutcaster not unfollowing locked teams, refs…

… #1292
  • Loading branch information
rmarquis committed Dec 2, 2019
1 parent 0fb1cfb commit 131fa12737dfcc3e2c1a2fe64601b4646664b85c
Showing with 15 additions and 0 deletions.
  1. +15 −0 src/game/g_referee.c
@@ -758,6 +758,21 @@ void G_RemoveShoutcaster(gentity_t *ent)
if (!ent->client->sess.referee) // don't remove referee's invitation
{
ent->client->sess.spec_invite = 0;

// unfollow player if team is spec locked
if (ent->client->sess.spectatorState == SPECTATOR_FOLLOW)
{
int spectatorClientTeam = level.clients[ent->client->sess.spectatorClient].sess.sessionTeam;

if (spectatorClientTeam == TEAM_AXIS && teamInfo[TEAM_AXIS].spec_lock)
{
StopFollowing(ent);
}
else if (spectatorClientTeam == TEAM_ALLIES && teamInfo[TEAM_ALLIES].spec_lock)
{
StopFollowing(ent);
}
}
}

ClientUserinfoChanged(ent - g_entities);

0 comments on commit 131fa12

Please sign in to comment.
You can’t perform that action at this time.