Fixes
This commit is contained in:
@@ -68,7 +68,7 @@ protected:
|
|||||||
|
|
||||||
const std::string m_ComponentType;
|
const std::string m_ComponentType;
|
||||||
|
|
||||||
virtual void UpdateComponent(EntityWrapper& entity, ComponentWrapper& component, double dt) = 0;
|
virtual void UpdateComponent(EntityWrapper& entity, ComponentWrapper& scoreScreen, double dt) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
class ImpureSystem : public virtual System
|
class ImpureSystem : public virtual System
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ class ScoreScreenSystem : public PureSystem
|
|||||||
public:
|
public:
|
||||||
ScoreScreenSystem(SystemParams params);
|
ScoreScreenSystem(SystemParams params);
|
||||||
|
|
||||||
virtual void UpdateComponent(EntityWrapper& entity, ComponentWrapper& capturePoint, double dt) override;
|
virtual void UpdateComponent(EntityWrapper& entity, ComponentWrapper& scoreScreen, double dt) override;
|
||||||
|
|
||||||
EventRelay<ScoreScreenSystem, Events::KillDeath> m_EPlayerDeath;
|
EventRelay<ScoreScreenSystem, Events::KillDeath> m_EPlayerDeath;
|
||||||
bool OnPlayerDeath(const Events::KillDeath& e);
|
bool OnPlayerDeath(const Events::KillDeath& e);
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ ScoreScreenSystem::ScoreScreenSystem(SystemParams params)
|
|||||||
EVENT_SUBSCRIBE_MEMBER(m_EPlayerDisconnected, &ScoreScreenSystem::OnPlayerDisconnected);
|
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) {
|
if (!IsServer) {
|
||||||
return;
|
return;
|
||||||
@@ -28,6 +28,8 @@ void ScoreScreenSystem::UpdateComponent(EntityWrapper& entity, ComponentWrapper&
|
|||||||
|
|
||||||
if(entity.HasComponent("Team")) {
|
if(entity.HasComponent("Team")) {
|
||||||
currentTeam = (int)entity["Team"]["Team"];
|
currentTeam = (int)entity["Team"]["Team"];
|
||||||
|
} else {
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto children = entity.ChildrenWithComponent("ScoreIdentity");
|
auto children = entity.ChildrenWithComponent("ScoreIdentity");
|
||||||
@@ -56,6 +58,9 @@ void ScoreScreenSystem::UpdateComponent(EntityWrapper& entity, ComponentWrapper&
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
found = true;
|
found = true;
|
||||||
|
if(!child.Valid()) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
//Update Deaths for child
|
//Update Deaths for child
|
||||||
(int&)child["ScoreIdentity"]["Kills"] = it->second.Kills;
|
(int&)child["ScoreIdentity"]["Kills"] = it->second.Kills;
|
||||||
//Update Kills for child
|
//Update Kills for child
|
||||||
|
|||||||
Reference in New Issue
Block a user