diff --git a/GoldWars/GoldWars/Entities/Base.swift b/GoldWars/GoldWars/Entities/Base.swift index e01ba62..a199068 100644 --- a/GoldWars/GoldWars/Entities/Base.swift +++ b/GoldWars/GoldWars/Entities/Base.swift @@ -46,11 +46,13 @@ class Base: GKEntity{ if base.ownershipPlayer != GKLocalPlayer.local { base.changeOwnership = true } - base.ownershipPlayer = self.ownershipPlayer self.unitCount -= units base.unitCount += units self.component(ofType: DefaultBaseComponent.self)?.labelNode.text = "\(self.unitCount)" - base.component(ofType: DefaultBaseComponent.self)?.labelNode.text = "\(base.unitCount)" + if base.ownershipPlayer == GKLocalPlayer.local { + base.component(ofType: DefaultBaseComponent.self)?.labelNode.text = "\(base.unitCount)" + } + base.ownershipPlayer = self.ownershipPlayer DataService.sharedInstance.addMove(playerMove: PlayerMove(fromBase: self.baseID, toBase: base.baseID, unitCount: units * playerMoveType.rawValue)