Boost icon fix

This commit is contained in:
Tleety
2016-03-12 17:30:28 +01:00
parent d51ea3cabd
commit f7363eeea4
2 changed files with 9 additions and 7 deletions
+8 -6
View File
@@ -5,11 +5,13 @@ void BoostIconsHUDSystem::UpdateComponent(EntityWrapper& entity, ComponentWrappe
EntityWrapper assaultEntity = entity.FirstChildByName("Assault"); EntityWrapper assaultEntity = entity.FirstChildByName("Assault");
EntityWrapper defenderEntity = entity.FirstChildByName("Defender"); EntityWrapper defenderEntity = entity.FirstChildByName("Defender");
EntityWrapper sniperEntity = entity.FirstChildByName("Sniper"); EntityWrapper sniperEntity = entity.FirstChildByName("Sniper");
EntityWrapper player = entity.FirstParentWithComponent("Player");
if(assaultEntity.Valid()) { if(assaultEntity.Valid()) {
if (assaultEntity.HasComponent("Fill")) { if (assaultEntity.HasComponent("Fill")) {
EntityWrapper parentWithAssaultBoost = assaultEntity.FirstParentWithComponent("BoostAssault"); EntityWrapper assaultBoost = player.FirstChildByName("BoostAssault");
if (parentWithAssaultBoost.Valid()) { if (assaultBoost.Valid()) {
(double&)assaultEntity["Fill"]["Percentage"] = 1.0; (double&)assaultEntity["Fill"]["Percentage"] = 1.0;
} else { } else {
(double&)assaultEntity["Fill"]["Percentage"] = 0.0; (double&)assaultEntity["Fill"]["Percentage"] = 0.0;
@@ -19,8 +21,8 @@ void BoostIconsHUDSystem::UpdateComponent(EntityWrapper& entity, ComponentWrappe
if (defenderEntity.Valid()) { if (defenderEntity.Valid()) {
if (defenderEntity.HasComponent("Fill")) { if (defenderEntity.HasComponent("Fill")) {
EntityWrapper parentWithAssaultBoost = defenderEntity.FirstParentWithComponent("BoostDefender"); EntityWrapper defenderBoost = player.FirstChildByName("BoostDefender");
if (parentWithAssaultBoost.Valid()) { if (defenderBoost.Valid()) {
(double&)defenderEntity["Fill"]["Percentage"] = 1.0; (double&)defenderEntity["Fill"]["Percentage"] = 1.0;
} else { } else {
(double&)defenderEntity["Fill"]["Percentage"] = 0.0; (double&)defenderEntity["Fill"]["Percentage"] = 0.0;
@@ -30,8 +32,8 @@ void BoostIconsHUDSystem::UpdateComponent(EntityWrapper& entity, ComponentWrappe
if (sniperEntity.Valid()) { if (sniperEntity.Valid()) {
if (sniperEntity.HasComponent("Fill")) { if (sniperEntity.HasComponent("Fill")) {
EntityWrapper parentWithAssaultBoost = sniperEntity.FirstParentWithComponent("BoostSniper"); EntityWrapper sniperBoost = player.FirstChildByName("BoostSniper");
if (parentWithAssaultBoost.Valid()) { if (sniperBoost.Valid()) {
(double&)sniperEntity["Fill"]["Percentage"] = 1.0; (double&)sniperEntity["Fill"]["Percentage"] = 1.0;
} else { } else {
(double&)sniperEntity["Fill"]["Percentage"] = 0.0; (double&)sniperEntity["Fill"]["Percentage"] = 0.0;
+1 -1
View File
@@ -44,7 +44,7 @@ bool EndScreenSystem::OnWin(const Events::Win& e)
if (blueText.HasComponent("Text")) if (blueText.HasComponent("Text"))
(bool&)blueText["Text"]["Visible"] = false; (bool&)blueText["Text"]["Visible"] = false;
}else if (e.TeamThatWon == 1) { }else if (e.TeamThatWon == 3) {
//Blue team won //Blue team won
if (redSprite.HasComponent("Sprite")) if (redSprite.HasComponent("Sprite"))
(bool&)redSprite["Sprite"]["Visible"] = false; (bool&)redSprite["Sprite"]["Visible"] = false;