From 276d2cfa2e490ed3cc8517b2d1f296992a1651ae Mon Sep 17 00:00:00 2001 From: Jakob Haag Date: Mon, 11 May 2020 18:04:35 +0200 Subject: [PATCH] add player to teamcomponent --- GoldWars/GoldWars/Entities/Base.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 } }