bugfix: sam not targeting after capture

This commit is contained in:
evanpelle
2025-08-16 10:54:05 -07:00
parent 0501364a77
commit 5fe199ae9e
+3 -8
View File
@@ -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];