Make Exit Conditional

This commit is contained in:
Mustafa Alperen Seki
2018-10-08 20:45:38 +00:00
committed by Paul Chote
parent 47c4be9191
commit faa35946b8
5 changed files with 35 additions and 28 deletions

View File

@@ -119,14 +119,14 @@ namespace OpenRA.Mods.Common.Traits
});
}
protected virtual ExitInfo SelectExit(Actor self, ActorInfo producee, string productionType, Func<ExitInfo, bool> p)
protected virtual Exit SelectExit(Actor self, ActorInfo producee, string productionType, Func<Exit, bool> p)
{
return self.RandomExitOrDefault(productionType, p);
return self.RandomExitOrDefault(self.World, productionType, p);
}
protected ExitInfo SelectExit(Actor self, ActorInfo producee, string productionType)
protected Exit SelectExit(Actor self, ActorInfo producee, string productionType)
{
return SelectExit(self, producee, productionType, e => CanUseExit(self, producee, e));
return SelectExit(self, producee, productionType, e => CanUseExit(self, producee, e.Info));
}
public virtual bool Produce(Actor self, ActorInfo producee, string productionType, TypeDictionary inits)
@@ -139,7 +139,7 @@ namespace OpenRA.Mods.Common.Traits
if (exit != null || self.OccupiesSpace == null)
{
DoProduction(self, producee, exit, productionType, inits);
DoProduction(self, producee, exit.Info, productionType, inits);
return true;
}