mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-24 13:52:45 +00:00
bugfix: sam not targeting after capture
This commit is contained in:
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user