Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/ai/petra/navalManager.js
Show First 20 Lines • Show All 373 Lines • ▼ Show 20 Lines | |||||
/** | /** | ||||
* complete already existing plan or create a new one for this requirement | * complete already existing plan or create a new one for this requirement | ||||
* (many units can then call this separately and end up in the same plan) | * (many units can then call this separately and end up in the same plan) | ||||
* TODO check garrison classes | * TODO check garrison classes | ||||
*/ | */ | ||||
m.NavalManager.prototype.requireTransport = function(gameState, entity, startIndex, endIndex, endPos) | m.NavalManager.prototype.requireTransport = function(gameState, entity, startIndex, endIndex, endPos) | ||||
{ | { | ||||
if (!entity.canGarrison()) | |||||
return false; | |||||
if (entity.getMetadata(PlayerID, "transport") !== undefined) | if (entity.getMetadata(PlayerID, "transport") !== undefined) | ||||
{ | { | ||||
if (this.Config.debug > 0) | if (this.Config.debug > 0) | ||||
API3.warn("Petra naval manager error: unit " + entity.id() + " has already required a transport"); | API3.warn("Petra naval manager error: unit " + entity.id() + " has already required a transport"); | ||||
return false; | return false; | ||||
} | } | ||||
for (let plan of this.transportPlans) | for (let plan of this.transportPlans) | ||||
▲ Show 20 Lines • Show All 405 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator