1
0
forked from 0ad/0ad

Fix AI using Maurya elephant archers as hunters following 164af0742a

The Maurya elephant archer is a fast moving citizen soldier, despite
being unable to gather.
This led to an issue post 164af0742a.

Reviewed By: bb
Fixes #5800

Differential Revision: https://code.wildfiregames.com/D2962
This was SVN commit r24009.
This commit is contained in:
wraitii 2020-08-31 09:05:34 +00:00
parent 0292962756
commit 32886202a3
2 changed files with 2 additions and 1 deletions

View File

@ -650,7 +650,7 @@ PETRA.BaseManager.prototype.reassignIdleWorkers = function(gameState, idleWorker
}
}
}
else if (PETRA.isFastMoving(ent))
else if (PETRA.isFastMoving(ent) && ent.canGather("food") && ent.canAttackClass("Animal"))
ent.setMetadata(PlayerID, "subrole", "hunter");
else if (ent.hasClass("FishingBoat"))
ent.setMetadata(PlayerID, "subrole", "fisher");

View File

@ -27,6 +27,7 @@
</Health>
<Identity>
<Civ>maur</Civ>
<Classes datatype="tokens">-FastMoving</Classes>
<VisibleClasses datatype="tokens">-Cavalry Elephant</VisibleClasses>
<GenericName>Elephant Archer</GenericName>
<Icon>units/maur_cavalry_archer.png</Icon>