add player to teamcomponent

This commit is contained in:
Jakob Haag 2020-05-11 18:04:35 +02:00
parent f67c673ca7
commit 276d2cfa2e

View File

@ -25,8 +25,8 @@ class Base: GKEntity {
super.init() super.init()
addComponent(DefaultBaseComponent(texture: SKTexture(imageNamed: "Base"), position: position)) addComponent(DefaultBaseComponent(texture: SKTexture(imageNamed: "Base"), position: position))
if(team != nil){ if(team != nil && player != nil){
addComponent(TeamComponent(team: team!, position: position)) addComponent(TeamComponent(team: team!, position: position, player: player!))
self.unitCount = 500 self.unitCount = 500
} }
} }