diff --git a/GoldWars/GoldWars/Entities/Base.swift b/GoldWars/GoldWars/Entities/Base.swift index e50a690..7fd86b3 100644 --- a/GoldWars/GoldWars/Entities/Base.swift +++ b/GoldWars/GoldWars/Entities/Base.swift @@ -25,8 +25,8 @@ class Base: GKEntity { super.init() addComponent(DefaultBaseComponent(texture: SKTexture(imageNamed: "Base"), position: position)) - if(team != nil){ - addComponent(TeamComponent(team: team!, position: position)) + if(team != nil && player != nil){ + addComponent(TeamComponent(team: team!, position: position, player: player!)) self.unitCount = 500 } }