diff --git a/GoldWars/GoldWars/Entities/Base.swift b/GoldWars/GoldWars/Entities/Base.swift index 65e0c3c..8166bad 100644 --- a/GoldWars/GoldWars/Entities/Base.swift +++ b/GoldWars/GoldWars/Entities/Base.swift @@ -51,7 +51,11 @@ class Base: GKEntity{ self.component(ofType: TeamComponent.self)?.unitcountLabel.text = "\(self.unitCount)" if base.component(ofType: TeamComponent.self)?.unitcountLabel.text != "" { - base.component(ofType: TeamComponent.self)?.unitcountLabel.text = "\(base.unitCount)" + if base.ownershipPlayer != self.ownershipPlayer { + base.component(ofType: TeamComponent.self)?.unitcountLabel.text = "\(abs(base.unitCount - units * 2))" + } else { + base.component(ofType: TeamComponent.self)?.unitcountLabel.text = "\(base.unitCount)" + } } DataService.sharedInstance.addMove(playerMove: PlayerMove(fromBase: self.baseID, toBase: base.baseID,