Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions src/core/execution/NukeExecution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,15 +191,17 @@ export class NukeExecution implements Execution {
// The launch tile can be overridden by the caller (e.g. MIRV warheads
// launch from the MIRV separation point, not a silo).
this.src ??= spawn;
// Nuke trajectories cannot pass over impassable terrain, just as they
// Nuke trajectories cannot pass over impassable terrain unless they are MIRV warheads, just as they
// cannot exceed the map border. Check the full parabola path before
// launching; if any tile is impassable, abort the launch.
const path = this.pathFinder.findPath(this.src, this.dst) ?? [];
for (const tile of path) {
if (this.mg.isImpassable(tile)) {
console.warn(`nuke trajectory crosses impassable terrain`);
this.active = false;
return;
if (this.nukeType !== UnitType.MIRVWarhead) {
const path = this.pathFinder.findPath(this.src, this.dst) ?? [];
for (const tile of path) {
if (this.mg.isImpassable(tile)) {
console.warn(`nuke trajectory crosses impassable terrain`);
this.active = false;
return;
}
Comment thread
TKTK123456 marked this conversation as resolved.
}
}
this.nuke = this.player.buildUnit(this.nukeType, this.src, {
Expand Down
Loading