Merge pull request #140 from teamfisk/FixNetworkBugs
Death explosion should always get triggered now.
This commit is contained in:
@@ -19,6 +19,7 @@
|
|||||||
#include "Core/World.h"
|
#include "Core/World.h"
|
||||||
#include "Core/EventBroker.h"
|
#include "Core/EventBroker.h"
|
||||||
#include "Core/ConfigFile.h"
|
#include "Core/ConfigFile.h"
|
||||||
|
#include "Core/EPlayerDeath.h"
|
||||||
#include "Input/EInputCommand.h"
|
#include "Input/EInputCommand.h"
|
||||||
#include "Core/EPlayerDamage.h"
|
#include "Core/EPlayerDamage.h"
|
||||||
#include "../Game/Events/EDoubleJump.h"
|
#include "../Game/Events/EDoubleJump.h"
|
||||||
|
|||||||
@@ -261,8 +261,14 @@ void Client::parseEntityDeletion(Packet & packet)
|
|||||||
if (m_ServerIDToClientID.find(entityToDelete) != m_ServerIDToClientID.end()) {
|
if (m_ServerIDToClientID.find(entityToDelete) != m_ServerIDToClientID.end()) {
|
||||||
EntityID localEntity = m_ServerIDToClientID.at(entityToDelete);
|
EntityID localEntity = m_ServerIDToClientID.at(entityToDelete);
|
||||||
if (m_World->ValidEntity(localEntity)) {
|
if (m_World->ValidEntity(localEntity)) {
|
||||||
m_World->DeleteEntity(localEntity);
|
if (m_World->HasComponent(localEntity,"Player")) {
|
||||||
deleteFromServerClientMaps(entityToDelete, localEntity);
|
Events::PlayerDeath e;
|
||||||
|
e.Player = EntityWrapper(m_World, localEntity);
|
||||||
|
m_EventBroker->Publish(e);
|
||||||
|
} else {
|
||||||
|
m_World->DeleteEntity(localEntity);
|
||||||
|
deleteFromServerClientMaps(entityToDelete, localEntity);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user