Skip to content

Commit

Permalink
game: fixed logged out shoutcaster not unfollowing locked teams, refs #…
Browse files Browse the repository at this point in the history
  • Loading branch information
rmarquis committed Dec 2, 2019
1 parent 0fb1cfb commit 131fa12
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/game/g_referee.c
Expand Up @@ -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);
Expand Down

0 comments on commit 131fa12

Please sign in to comment.