1
0
forked from 0ad/0ad

Minor garrisoning related tweaks

This was SVN commit r8778.
This commit is contained in:
evanssthomas 2010-12-03 20:25:21 +00:00
parent 3b817d2162
commit 238925f927
2 changed files with 12 additions and 2 deletions

View File

@ -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))

View File

@ -195,7 +195,8 @@ GuiInterface.prototype.GetEntityState = function(player, ent)
if (cmpGarrisonHolder)
{
ret.garrisonHolder = {
"entities": cmpGarrisonHolder.GetEntities()
"entities": cmpGarrisonHolder.GetEntities(),
"allowedClasses": cmpGarrisonHolder.GetAllowedClassesList()
};
}