Merge branch 'master' of github.com:teamfisk/TacticalZ

This commit is contained in:
2016-03-13 19:54:22 +01:00
23 changed files with 10737 additions and 8405 deletions
+16 -4
View File
@@ -9,6 +9,7 @@ SpectatorCameraSystem::SpectatorCameraSystem(SystemParams params)
{
EVENT_SUBSCRIBE_MEMBER(m_EInputCommand, &SpectatorCameraSystem::OnInputCommand);
EVENT_SUBSCRIBE_MEMBER(m_EDisconnect, &SpectatorCameraSystem::OnDisconnect);
EVENT_SUBSCRIBE_MEMBER(m_EReset, &SpectatorCameraSystem::OnReset);
}
void SpectatorCameraSystem::Update(double dt)
@@ -27,6 +28,14 @@ void SpectatorCameraSystem::Update(double dt)
}
}
void SpectatorCameraSystem::reset()
{
m_CamSetToTeamPick = false;
// They will also be set to menu, so unlock mouse just in case they were in game with locked mouse.
Events::UnlockMouse unlock;
m_EventBroker->Publish(unlock);
}
bool SpectatorCameraSystem::OnInputCommand(const Events::InputCommand& e)
{
// Only the client should do this, and only if player is not spawned.
@@ -99,10 +108,13 @@ bool SpectatorCameraSystem::OnDisconnect(const Events::PlayerDisconnected& e)
// If local player gets disconnected, they should be set to
// the spectator camera next time a map loads that has one.
if (e.Entity == LocalPlayer.ID) {
m_CamSetToTeamPick = false;
// They will also be set to menu, so unlock mouse just in case they were in game with locked mouse.
Events::UnlockMouse unlock;
m_EventBroker->Publish(unlock);
reset();
}
return true;
}
bool SpectatorCameraSystem::OnReset(const Events::Reset & e)
{
reset();
return true;
}