Skip to content

Commit 97a19fb

Browse files
committed
update(player): Fix move to spectator
1 parent 219d253 commit 97a19fb

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/player/Player.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,10 @@ void Player::SwitchTeam(int team)
8686
if (!playerController)
8787
return;
8888

89-
g_Signatures->FetchSignature<CCSPlayerController_SwitchTeam>("CCSPlayerController_SwitchTeam")(playerController, team);
89+
if (team == CS_TEAM_SPECTATOR)
90+
CALL_VIRTUAL(void, g_Offsets->GetOffset("ChangeTeam"), playerController, team);
91+
else
92+
g_Signatures->FetchSignature<CCSPlayerController_SwitchTeam>("CCSPlayerController_SwitchTeam")(playerController, team);
9093
}
9194

9295
void Player::Authenticate()

0 commit comments

Comments
 (0)