fix crash when sending HELI to FIX

This commit is contained in:
Chris Forbes
2010-01-16 14:33:28 +13:00
parent 0b71ebfa58
commit f475b0fbbd

View File

@@ -60,8 +60,8 @@ namespace OpenRa.Game.Traits
if (res != null)
reservation = res.Reserve(self);
var productionInfo = order.TargetActor.Info.Traits.Get<ProductionInfo>();
var offset = productionInfo.SpawnOffset;
var productionInfo = order.TargetActor.Info.Traits.GetOrDefault<ProductionInfo>();
var offset = productionInfo != null ? productionInfo.SpawnOffset : null;
var offsetVec = offset != null ? new float2(offset[0], offset[1]) : float2.Zero;
self.CancelActivity();