Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/ai/petra/garrisonManager.js
Show First 20 Lines • Show All 199 Lines • ▼ Show 20 Lines | else if (this.numberOfGarrisonedUnits(ent) < gmin) | ||||
gameState.ai.HQ.defenseManager.garrisonUnitsInside(gameState, ent, { "min": gmin, "type": "decay" }); | gameState.ai.HQ.defenseManager.garrisonUnitsInside(gameState, ent, { "min": gmin, "type": "decay" }); | ||||
} | } | ||||
}; | }; | ||||
/** TODO should add the units garrisoned inside garrisoned units */ | /** TODO should add the units garrisoned inside garrisoned units */ | ||||
m.GarrisonManager.prototype.numberOfGarrisonedUnits = function(holder) | m.GarrisonManager.prototype.numberOfGarrisonedUnits = function(holder) | ||||
{ | { | ||||
if (!this.holders.has(holder.id())) | if (!this.holders.has(holder.id())) | ||||
return holder.garrisoned().length; | return holder.garrisonedSlots(); | ||||
return holder.garrisoned().length + this.holders.get(holder.id()).list.length; | return holder.garrisonedSlots() + this.holders.get(holder.id()).list.length; | ||||
}; | }; | ||||
m.GarrisonManager.prototype.allowMelee = function(holder) | m.GarrisonManager.prototype.allowMelee = function(holder) | ||||
{ | { | ||||
if (!this.holders.has(holder.id())) | if (!this.holders.has(holder.id())) | ||||
return undefined; | return undefined; | ||||
return this.holders.get(holder.id()).allowMelee; | return this.holders.get(holder.id()).allowMelee; | ||||
▲ Show 20 Lines • Show All 155 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator