Class enum instead of hardcoded ints.

Removed superfluous .Valid() checks.

Check for spectator spawnrequest in case they somehow has a class, so we don't get "x players were supposed to be spawned but failed" if it happens.
This commit is contained in:
William Moberg
2016-03-09 11:35:32 +01:00
parent b782e73556
commit 534d6639e5
4 changed files with 29 additions and 19 deletions
+2 -2
View File
@@ -15,7 +15,7 @@ void SpectatorCameraSystem::Update(double dt)
if (!m_CamSetToTeamPick && IsClient) {
// Find the class pick camera and set them to it, since they need to pick a team before they can leave the screen.
EntityWrapper spectatorCam = m_World->GetFirstEntityByName("PickTeamCamera");
if (spectatorCam.Valid() && spectatorCam.HasComponent("Camera")) {
if (spectatorCam.HasComponent("Camera")) {
m_CamSetToTeamPick = true;
Events::SetCamera eSetCamera;
eSetCamera.CameraEntity = spectatorCam;
@@ -59,7 +59,7 @@ bool SpectatorCameraSystem::OnInputCommand(const Events::InputCommand& e)
}
EntityWrapper spectatorCam = m_World->GetFirstEntityByName(camName);
// Set the camera as active, if it exists.
if (spectatorCam.Valid() && spectatorCam.HasComponent("Camera")) {
if (spectatorCam.HasComponent("Camera")) {
// Set the class pick button visible if a blue or red team is picked, else invisible.
EntityWrapper HUD;
if (camName == "SpectatorCamera") {