Properly check for exitinfo != null in DoProduction()

This commit is contained in:
Mustafa Alperen Seki
2019-04-20 20:38:43 +03:00
committed by reaperrr
parent 1573da03bb
commit f9ef41f165

View File

@@ -50,7 +50,7 @@ namespace OpenRA.Mods.Common.Traits
foreach (var init in inits)
td.Add(init);
if (self.OccupiesSpace != null)
if (exitinfo != null && self.OccupiesSpace != null)
{
exit = self.Location + exitinfo.ExitCell;
var spawn = self.CenterPosition + exitinfo.SpawnOffset;
@@ -82,7 +82,7 @@ namespace OpenRA.Mods.Common.Traits
var newUnit = self.World.CreateActor(producee.Name, td);
var move = newUnit.TraitOrDefault<IMove>();
if (move != null)
if (exitinfo != null && move != null)
{
if (exitinfo.MoveIntoWorld)
{