Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/ai/petra/headquarters.js
Show First 20 Lines • Show All 392 Lines • ▼ Show 20 Lines | for (let evt of events.TrainingFinished) | ||||
{ | { | ||||
let ent = gameState.getEntityById(entId); | let ent = gameState.getEntityById(entId); | ||||
if (!ent || !ent.isOwn(PlayerID)) | if (!ent || !ent.isOwn(PlayerID)) | ||||
continue; | continue; | ||||
if (!ent.position()) | if (!ent.position()) | ||||
{ | { | ||||
// we are autogarrisoned, check that the holder is registered in the garrisonManager | // we are autogarrisoned, check that the holder is registered in the garrisonManager | ||||
let holderId = ent.unitAIOrderData()[0].target; | let holderId = ent.garrisonHolder(); | ||||
Silier: inline :) | |||||
let holder = gameState.getEntityById(holderId); | let holder = gameState.getEntityById(holderId); | ||||
if (holder) | if (holder) | ||||
this.garrisonManager.registerHolder(gameState, holder); | this.garrisonManager.registerHolder(gameState, holder); | ||||
} | } | ||||
else if (ent.getMetadata(PlayerID, "garrisonType")) | else if (ent.getMetadata(PlayerID, "garrisonType")) | ||||
{ | { | ||||
// we were supposed to be autogarrisoned, but this has failed (may-be full) | // we were supposed to be autogarrisoned, but this has failed (may-be full) | ||||
ent.setMetadata(PlayerID, "garrisonType", undefined); | ent.setMetadata(PlayerID, "garrisonType", undefined); | ||||
▲ Show 20 Lines • Show All 2,485 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator
inline :)