From 0dd1664506133f6e56dac8e4f518944f65da3d63 Mon Sep 17 00:00:00 2001 From: Jakob Haag Date: Sat, 9 May 2020 15:23:28 +0200 Subject: [PATCH] change ownerShipPlayer on attackBase function --- GoldWars/GoldWars/Entities/Base.swift | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/GoldWars/GoldWars/Entities/Base.swift b/GoldWars/GoldWars/Entities/Base.swift index 6851cf3..e8384bd 100644 --- a/GoldWars/GoldWars/Entities/Base.swift +++ b/GoldWars/GoldWars/Entities/Base.swift @@ -32,11 +32,12 @@ class Base: GKEntity { } func attackBase(base: Base, units:Int) -> [GKEntity]{ - base.changeOwnerShip = true - self.unitCount -= units - base.unitCount += units - return [self, base] - } + base.changeOwnerShip = true + base.ownerShipPlayer = self.ownerShipPlayer + self.unitCount -= units + base.unitCount += units + return [self, base] + } required init?(coder: NSCoder) { fatalError("init(coder:) has not been implemented")