Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/ai/petra/transportPlan.js
Show First 20 Lines • Show All 247 Lines • ▼ Show 20 Lines | |||||
/** TODO not currently used ... to be fixed */ | /** TODO not currently used ... to be fixed */ | ||||
PETRA.TransportPlan.prototype.cancelTransport = function(gameState) | PETRA.TransportPlan.prototype.cancelTransport = function(gameState) | ||||
{ | { | ||||
let ent = this.units.toEntityArray()[0]; | let ent = this.units.toEntityArray()[0]; | ||||
let base = gameState.ai.HQ.getBaseByID(ent.getMetadata(PlayerID, "base")); | let base = gameState.ai.HQ.getBaseByID(ent.getMetadata(PlayerID, "base")); | ||||
if (!base.anchor || !base.anchor.position()) | if (!base.anchor || !base.anchor.position()) | ||||
{ | { | ||||
for (let newbase of gameState.ai.HQ.baseManagers) | for (const newbase of gameState.ai.HQ.baseManagers()) | ||||
{ | { | ||||
if (!newbase.anchor || !newbase.anchor.position()) | if (!newbase.anchor || !newbase.anchor.position()) | ||||
continue; | continue; | ||||
ent.setMetadata(PlayerID, "base", newbase.ID); | ent.setMetadata(PlayerID, "base", newbase.ID); | ||||
base = newbase; | base = newbase; | ||||
break; | break; | ||||
} | } | ||||
if (!base.anchor || !base.anchor.position()) | if (!base.anchor || !base.anchor.position()) | ||||
▲ Show 20 Lines • Show All 459 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator