Added a blocking check to Production::CanUseExit

This commit is contained in:
Ian T. Jacobsen
2014-02-04 13:50:08 +00:00
parent 2f2afd9fc5
commit eba8e8f33f

View File

@@ -124,6 +124,13 @@ namespace OpenRA.Mods.RA
{
var mobileInfo = producee.Traits.GetOrDefault<MobileInfo>();
foreach (var blocker in self.World.ActorMap.GetUnitsAt(self.Location + s.ExitCell))
{
// Notify the blocker that he's blocking our move:
foreach (var moveBlocked in blocker.TraitsImplementing<INotifyBlockingMove>())
moveBlocked.OnNotifyBlockingMove(blocker, self);
}
return mobileInfo == null ||
mobileInfo.CanEnterCell(self.World, self, self.Location + s.ExitCell, self, true, true);
}