From 252c8333203056ae484fd12d5cc4a727c5e5379b Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Sat, 19 Oct 2019 17:50:04 +0100 Subject: [PATCH] Don't override spawn CenterPosition for non-aircraft reinforcements. --- OpenRA.Mods.Common/Scripting/Global/ReinforcementsGlobal.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/OpenRA.Mods.Common/Scripting/Global/ReinforcementsGlobal.cs b/OpenRA.Mods.Common/Scripting/Global/ReinforcementsGlobal.cs index 7f41f6c224..152b3f40c8 100644 --- a/OpenRA.Mods.Common/Scripting/Global/ReinforcementsGlobal.cs +++ b/OpenRA.Mods.Common/Scripting/Global/ReinforcementsGlobal.cs @@ -47,9 +47,11 @@ namespace OpenRA.Mods.Common.Scripting if (entryLocation.HasValue) { - var pi = ai.TraitInfoOrDefault(); - initDict.Add(new CenterPositionInit(owner.World.Map.CenterOfCell(entryLocation.Value) + new WVec(0, 0, pi != null ? pi.CruiseAltitude.Length : 0))); initDict.Add(new LocationInit(entryLocation.Value)); + + var pi = ai.TraitInfoOrDefault(); + if (pi != null) + initDict.Add(new CenterPositionInit(owner.World.Map.CenterOfCell(entryLocation.Value) + new WVec(0, 0, pi.CruiseAltitude.Length))); } if (entryLocation.HasValue && nextLocation.HasValue)