diff --git a/src/core/execution/SAMLauncherExecution.ts b/src/core/execution/SAMLauncherExecution.ts index 15891db07..171a3cc77 100644 --- a/src/core/execution/SAMLauncherExecution.ts +++ b/src/core/execution/SAMLauncherExecution.ts @@ -25,7 +25,6 @@ class SAMTargetingSystem { constructor( private mg: Game, - private player: Player, private sam: Unit, ) {} @@ -82,8 +81,8 @@ class SAMTargetingSystem { ({ unit }) => { return ( isUnit(unit) && - unit.owner() !== this.player && - !this.player.isFriendly(unit.owner()) + unit.owner() !== this.sam.owner() && + !this.sam.owner().isFriendly(unit.owner()) ); }, ); @@ -179,11 +178,7 @@ export class SAMLauncherExecution implements Execution { } this.sam = this.player.buildUnit(UnitType.SAMLauncher, spawnTile, {}); } - this.targetingSystem ??= new SAMTargetingSystem( - this.mg, - this.player, - this.sam, - ); + this.targetingSystem ??= new SAMTargetingSystem(this.mg, this.sam); if (this.sam.isInCooldown()) { const frontTime = this.sam.missileTimerQueue()[0];