PickClass used for class-picking, SwapToClassPick to swap camera.

This commit is contained in:
William Moberg
2016-03-03 16:59:17 +01:00
parent 398bc725b6
commit 98366ec038
3 changed files with 7 additions and 5 deletions
+4 -4
View File
@@ -105,7 +105,7 @@ void PlayerSpawnSystem::Update(double dt)
bool PlayerSpawnSystem::OnInputCommand(Events::InputCommand& e)
{
if (e.Command != "PickTeam" && e.Command != "PickClass") {
if (e.Command != "PickTeam" && e.Command != "SwapToClassPick") {
return false;
}
@@ -117,7 +117,7 @@ bool PlayerSpawnSystem::OnInputCommand(Events::InputCommand& e)
if (IsClient && !LocalPlayer.Valid()) {
// Set the camera as active, if it exists.
// Find the respawn camera or class pick camera.
std::string camName = e.Command == "PickClass" ? "PickClassCamera" : "SpectatorCamera";
std::string camName = e.Command == "SwapToClassPick" ? "PickClassCamera" : "SpectatorCamera";
EntityWrapper spectatorCam = m_World->GetFirstEntityByName(camName);
if (spectatorCam.Valid() && spectatorCam.HasComponent("Camera")) {
Events::SetCamera eSetCamera;
@@ -137,14 +137,14 @@ bool PlayerSpawnSystem::OnInputCommand(Events::InputCommand& e)
for (; iter != m_SpawnRequests.end(); ++iter) {
if (iter->PlayerID == e.PlayerID) {
// If player wants to switch class, remove their spawn request.
if (e.Command == "PickClass") {
if (e.Command == "SwapToClassPick") {
m_SpawnRequests.erase(iter);
}
break;
}
}
if (e.Command == "PickClass") {
if (e.Command == "SwapToClassPick") {
return true;
}