mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-17 09:19:13 +00:00
SAM not working against MIRV warhead (#818)
## Description: The nukes are setting a `detonationDst` that is never used in UnitImpl. Without the target tile, SAM launchers ignore the MIRV warheads. Illustration with 50 SAM vs 2 warhead:  The nuke icon is also staying white while being nuked:  ## Please complete the following: - [x] I have added screenshots for all UI updates - [x] I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced - [x] I understand that submitting code with bugs that could have been caught through manual testing blocks releases and new features for all contributors ## Please put your Discord username so you can be contacted if a bug or regression is found: IngloriousTom
This commit is contained in:
@@ -119,7 +119,7 @@ export class NukeExecution implements Execution {
|
||||
this.type !== UnitType.MIRVWarhead,
|
||||
);
|
||||
this.nuke = this.player.buildUnit(this.type, spawn, {
|
||||
detonationDst: this.dst,
|
||||
targetTile: this.dst,
|
||||
});
|
||||
if (this.mg.hasOwner(this.dst)) {
|
||||
const target = this.mg.owner(this.dst);
|
||||
|
||||
@@ -164,9 +164,13 @@ export interface UnitParamsMap {
|
||||
|
||||
[UnitType.Port]: {};
|
||||
|
||||
[UnitType.AtomBomb]: {};
|
||||
[UnitType.AtomBomb]: {
|
||||
targetTile?: number;
|
||||
};
|
||||
|
||||
[UnitType.HydrogenBomb]: {};
|
||||
[UnitType.HydrogenBomb]: {
|
||||
targetTile?: number;
|
||||
};
|
||||
|
||||
[UnitType.TradeShip]: {
|
||||
dstPort: Unit;
|
||||
@@ -185,7 +189,9 @@ export interface UnitParamsMap {
|
||||
|
||||
[UnitType.MIRV]: {};
|
||||
|
||||
[UnitType.MIRVWarhead]: {};
|
||||
[UnitType.MIRVWarhead]: {
|
||||
targetTile?: number;
|
||||
};
|
||||
|
||||
[UnitType.Construction]: {};
|
||||
}
|
||||
|
||||
@@ -39,7 +39,8 @@ export class UnitImpl implements Unit {
|
||||
) {
|
||||
this._lastTile = _tile;
|
||||
this._health = toInt(this.mg.unitInfo(_type).maxHealth ?? 1);
|
||||
|
||||
this._targetTile =
|
||||
"targetTile" in params ? (params.targetTile ?? undefined) : undefined;
|
||||
this._troops = "troops" in params ? (params.troops ?? 0) : 0;
|
||||
this._lastSetSafeFromPirates =
|
||||
"lastSetSafeFromPirates" in params
|
||||
|
||||
Reference in New Issue
Block a user