This commit is contained in:
Tleety
2016-03-04 02:52:04 +01:00
parent 45991000ae
commit 0e95c5bb95
3 changed files with 8 additions and 3 deletions
+6 -1
View File
@@ -11,7 +11,7 @@ ScoreScreenSystem::ScoreScreenSystem(SystemParams params)
EVENT_SUBSCRIBE_MEMBER(m_EPlayerDisconnected, &ScoreScreenSystem::OnPlayerDisconnected);
}
void ScoreScreenSystem::UpdateComponent(EntityWrapper& entity, ComponentWrapper& capturePoint, double dt)
void ScoreScreenSystem::UpdateComponent(EntityWrapper& entity, ComponentWrapper& scoreScreen, double dt)
{
if (!IsServer) {
return;
@@ -28,6 +28,8 @@ void ScoreScreenSystem::UpdateComponent(EntityWrapper& entity, ComponentWrapper&
if(entity.HasComponent("Team")) {
currentTeam = (int)entity["Team"]["Team"];
} else {
return;
}
auto children = entity.ChildrenWithComponent("ScoreIdentity");
@@ -56,6 +58,9 @@ void ScoreScreenSystem::UpdateComponent(EntityWrapper& entity, ComponentWrapper&
}
}
found = true;
if(!child.Valid()) {
break;
}
//Update Deaths for child
(int&)child["ScoreIdentity"]["Kills"] = it->second.Kills;
//Update Kills for child