File tree Expand file tree Collapse file tree 3 files changed +9
-3
lines changed
Expand file tree Collapse file tree 3 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -92,9 +92,11 @@ export default class DominationArena extends ArenaEntity {
9292
9393 public spawnPlayer ( tank : TankBody , client : Client ) {
9494 const team = this . decideTeam ( client ) ;
95- const teamBase = team . base as TeamBase ;
9695 TeamEntity . setTeam ( team , tank ) ;
9796
97+ const teamBase = team . base ;
98+ if ( ! teamBase ) return super . spawnPlayer ( tank , client ) ;
99+
98100 const pos = ObjectEntity . getRandomPosition ( teamBase ) ;
99101 tank . positionData . values . x = pos . x ;
100102 tank . positionData . values . y = pos . y ;
Original file line number Diff line number Diff line change @@ -69,7 +69,9 @@ export default class Teams2Arena extends ArenaEntity {
6969 const success = this . attemptFactorySpawn ( tank ) ;
7070 if ( success ) return ; // This player was spawned from a factory instead
7171
72- const base = team . base as TeamBase ;
72+ const base = team . base ;
73+ if ( ! base ) return super . spawnPlayer ( tank , client ) ;
74+
7375 const pos = ObjectEntity . getRandomPosition ( base ) ;
7476 tank . positionData . x = pos . x ;
7577 tank . positionData . y = pos . y ;
Original file line number Diff line number Diff line change @@ -79,7 +79,9 @@ export default class Teams4Arena extends ArenaEntity {
7979 const success = this . attemptFactorySpawn ( tank ) ;
8080 if ( success ) return ; // This player was spawned from a factory instead
8181
82- const base = team . base as TeamBase ;
82+ const base = team . base ;
83+ if ( ! base ) return super . spawnPlayer ( tank , client ) ;
84+
8385 const pos = ObjectEntity . getRandomPosition ( base ) ;
8486 tank . positionData . x = pos . x ;
8587 tank . positionData . y = pos . y ;
You can’t perform that action at this time.
0 commit comments