Don't force to spectator camera if player presses pickTeam/Class prematurely. Players team should be remembered after picked, spawn request is not erased anymore.

This commit is contained in:
William Moberg
2016-03-08 18:26:17 +01:00
parent d7f09b1a8f
commit 7bc3c9f7b1
3 changed files with 18 additions and 8 deletions
+4 -8
View File
@@ -134,16 +134,12 @@ bool PlayerSpawnSystem::OnInputCommand(Events::InputCommand& e)
auto iter = m_SpawnRequests.begin();
for (; iter != m_SpawnRequests.end(); ++iter) {
if (iter->PlayerID == e.PlayerID) {
// If player wants to switch team, remove their spawn request.
if (e.Command == "SwapToTeamPick") {
m_SpawnRequests.erase(iter);
} else if (e.Command == "SwapToClassPick") {
// If player wants to switch class, remove their selected class so they don't spawn.
// If player wants to switch team or class , remove their selected class so they don't spawn.
if (e.Command == "SwapToTeamPick" || e.Command == "SwapToClassPick") {
iter->Class = -1;
} else {
break;
return true;
}
return true;
break;
}
}