From 4cf822cd002d9d6725d37f776335834329d0b4a7 Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Wed, 30 Jul 2014 22:18:29 +1200 Subject: [PATCH] Support production of actors without IFacing. --- OpenRA.Mods.RA/Production.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OpenRA.Mods.RA/Production.cs b/OpenRA.Mods.RA/Production.cs index b8004e535a..21745cf5c1 100755 --- a/OpenRA.Mods.RA/Production.cs +++ b/OpenRA.Mods.RA/Production.cs @@ -60,8 +60,8 @@ namespace OpenRA.Mods.RA var spawn = self.CenterPosition + exitinfo.SpawnOffset; var to = self.World.Map.CenterOfCell(exit); - var fi = producee.Traits.Get(); - var initialFacing = exitinfo.Facing < 0 ? Util.GetFacing(to - spawn, fi.GetInitialFacing()) : exitinfo.Facing; + var fi = producee.Traits.GetOrDefault(); + var initialFacing = exitinfo.Facing < 0 ? Util.GetFacing(to - spawn, fi == null ? 0 : fi.GetInitialFacing()) : exitinfo.Facing; var exitLocation = rp.Value != null ? rp.Value.Location : exit; var target = Target.FromCell(self.World, exitLocation);