Now only entities with NetworkComponent will be send in Snapshots.

This commit is contained in:
stiffly
2016-03-07 16:52:51 +01:00
parent f585f9ada9
commit 13c3bcb290
+1 -15
View File
@@ -641,21 +641,7 @@ void Server::parsePlayerTransform(Packet& packet)
bool Server::shouldSendToClient(EntityWrapper childEntity)
{
auto children = m_World->GetDirectChildren(childEntity.ID);
for (auto it = children.first; it != children.second; it++) {
EntityWrapper child(m_World, it->second);
if (child.HasComponent("CapturePoint") || child.HasComponent("HealthPickup")
|| child.HasComponent("AmmoPickup")) {
return true;
}
}
return childEntity.HasComponent("Player")
|| childEntity.FirstParentWithComponent("Player").Valid()
|| childEntity.HasComponent("CapturePoint")
|| childEntity.HasComponent("HealthPickup")
|| childEntity.HasComponent("AmmoPickup")
|| childEntity.HasComponent("ScoreScreen")
|| childEntity.FirstParentWithComponent("ScoreScreen").Valid();
return childEntity.HasComponent("NetworkComponent") ||childEntity.FirstParentWithComponent("Player").Valid();
}
PlayerID Server::getPlayerIDFromEndpoint()