Differential D104 Diff 2107 ps/trunk/binaries/data/mods/public/simulation/ai/petra/garrisonManager.js
Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/binaries/data/mods/public/simulation/ai/petra/garrisonManager.js
Show First 20 Lines • Show All 192 Lines • ▼ Show 20 Lines | if (!this.holders.has(holder.id())) | ||||
return undefined; | return undefined; | ||||
return this.holders.get(holder.id()).allowMelee; | return this.holders.get(holder.id()).allowMelee; | ||||
}; | }; | ||||
/** This is just a pre-garrison state, while the entity walk to the garrison holder */ | /** This is just a pre-garrison state, while the entity walk to the garrison holder */ | ||||
m.GarrisonManager.prototype.garrison = function(gameState, ent, holder, type) | m.GarrisonManager.prototype.garrison = function(gameState, ent, holder, type) | ||||
{ | { | ||||
if (this.numberOfGarrisonedUnits(holder) >= holder.garrisonMax()) | if (this.numberOfGarrisonedUnits(holder) >= holder.garrisonMax() || !ent.canGarrison()) | ||||
return; | return; | ||||
this.registerHolder(gameState, holder); | this.registerHolder(gameState, holder); | ||||
this.holders.get(holder.id()).list.push(ent.id()); | this.holders.get(holder.id()).list.push(ent.id()); | ||||
if (gameState.ai.Config.debug > 2) | if (gameState.ai.Config.debug > 2) | ||||
{ | { | ||||
warn("garrison unit " + ent.genericName() + " in " + holder.genericName() + " with type " + type); | warn("garrison unit " + ent.genericName() + " in " + holder.genericName() + " with type " + type); | ||||
▲ Show 20 Lines • Show All 138 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator