Improve the deploy routine so that baseCenter is still set even if the mcv is a fact

This commit is contained in:
Scott_NZ
2012-08-12 12:59:17 +12:00
parent 583c3f9a64
commit f648223c39

View File

@@ -438,12 +438,16 @@ namespace OpenRA.Mods.RA.AI
{
/* find our mcv and deploy it */
var mcv = self.World.Actors
.FirstOrDefault(a => a.Owner == p && a.HasTrait<BaseBuilding>() && a.HasTrait<Mobile>());
.FirstOrDefault(a => a.Owner == p && a.HasTrait<BaseBuilding>());
if (mcv != null)
{
baseCenter = mcv.Location;
world.IssueOrder(new Order("DeployTransform", mcv, false));
//Don't transform the mcv if it is a fact
if (mcv.HasTrait<Mobile>())
{
world.IssueOrder(new Order("DeployTransform", mcv, false));
}
}
else
BotDebug("AI: Can't find BaseBuildUnit.");