Minor garrisoning related tweaks
This was SVN commit r8778.
This commit is contained in:
parent
3b817d2162
commit
238925f927
@ -149,7 +149,16 @@ function getActionInfo(action, target)
|
||||
{
|
||||
case "garrison":
|
||||
if (isUnit(entState) && targetState.garrisonHolder && playerOwned)
|
||||
return {"possible": true};
|
||||
{
|
||||
var allowedClasses = targetState.garrisonHolder.allowedClasses;
|
||||
for each (var unitClass in entState.identity.classes)
|
||||
{
|
||||
if (allowedClasses.indexOf(unitClass) != -1)
|
||||
{
|
||||
return {"possible": true};
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case "gather":
|
||||
if (targetState.resourceSupply && (playerOwned || gaiaOwned))
|
||||
|
@ -195,7 +195,8 @@ GuiInterface.prototype.GetEntityState = function(player, ent)
|
||||
if (cmpGarrisonHolder)
|
||||
{
|
||||
ret.garrisonHolder = {
|
||||
"entities": cmpGarrisonHolder.GetEntities()
|
||||
"entities": cmpGarrisonHolder.GetEntities(),
|
||||
"allowedClasses": cmpGarrisonHolder.GetAllowedClassesList()
|
||||
};
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user