The logic for removing the world is working but when we send the map again the clients memory usage goes crazy.

This commit is contained in:
Jocke
2016-03-12 17:49:50 +01:00
parent 0c1a2d3160
commit c544f349fd
9 changed files with 64 additions and 12 deletions
+15 -4
View File
@@ -27,6 +27,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.
@@ -95,10 +103,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;
}