mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-09 11:58:06 +00:00
Fix sam targetting everything (#1280)
## Description: There was a regression on how sam targets nukes. This fixes it ## Please complete the following: - [x] I have added screenshots for all UI updates - [x] I process any text displayed to the user through translateText() and I've added it to the en.json file - [x] I have added relevant tests to the test directory - [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: Vivacious Box
This commit is contained in:
@@ -14,8 +14,6 @@ export class SAMLauncherExecution implements Execution {
|
||||
private mg: Game;
|
||||
private active: boolean = true;
|
||||
|
||||
private searchRangeRadius = 80;
|
||||
private targetRangeRadius = 120; // Nuke's target should be in this range to be focusable
|
||||
// As MIRV go very fast we have to detect them very early but we only
|
||||
// shoot the one targeting very close (MIRVWarheadProtectionRadius)
|
||||
private MIRVWarheadSearchRadius = 400;
|
||||
@@ -41,7 +39,7 @@ export class SAMLauncherExecution implements Execution {
|
||||
if (this.sam === null) return null;
|
||||
const nukes = this.mg.nearbyUnits(
|
||||
this.sam.tile(),
|
||||
this.searchRangeRadius,
|
||||
this.mg.config().defaultSamRange(),
|
||||
[UnitType.AtomBomb, UnitType.HydrogenBomb],
|
||||
({ unit }) =>
|
||||
unit.owner() !== this.player &&
|
||||
|
||||
Reference in New Issue
Block a user