Player death effect fixes

This commit is contained in:
2016-02-08 11:39:29 +01:00
parent fad25c6e16
commit 99cbdd3c1e
5 changed files with 39 additions and 32 deletions
+3 -1
View File
@@ -75,7 +75,9 @@ bool PlayerSpawnSystem::OnPlayerSpawned(Events::PlayerSpawned& e)
// Check if a player already exists
if (m_PlayerEntities.count(e.PlayerID) != 0) {
// TODO: Disallow infinite respawning here
m_World->DeleteEntity(m_PlayerEntities[e.PlayerID].ID);
if (m_PlayerEntities[e.PlayerID].Valid()) {
m_World->DeleteEntity(m_PlayerEntities[e.PlayerID].ID);
}
}
// Store the player for future reference