From 550db7e958c5c76cd99f4125cedc617c8bdc8581 Mon Sep 17 00:00:00 2001 From: RoosterDragon Date: Sun, 22 May 2022 14:50:03 +0100 Subject: [PATCH] Ensure SpawnStartingUnits initializes after Locomotor. Prior to ef44c31a72eab61a597cf539ee4b138e94b254fe, Locomotor would be earlier in the trait initialization sequence than SpawnStartingUnits. After this commit, the initialization sequence was perturbed and SpawnStartingUnits would initialize first. When SpawnStartingUnits would query CanEnterCell this would generate a null reference as Locomotor had not yet initialized. SpawnStartingUnitsInfo is made to initialize NotBefore LocomotorInfo to enforce the required trait ordering. --- OpenRA.Mods.Common/Traits/World/SpawnStartingUnits.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenRA.Mods.Common/Traits/World/SpawnStartingUnits.cs b/OpenRA.Mods.Common/Traits/World/SpawnStartingUnits.cs index 5a84a81cc2a3..56fb073ae292 100644 --- a/OpenRA.Mods.Common/Traits/World/SpawnStartingUnits.cs +++ b/OpenRA.Mods.Common/Traits/World/SpawnStartingUnits.cs @@ -20,7 +20,7 @@ namespace OpenRA.Mods.Common.Traits { [TraitLocation(SystemActors.World)] [Desc("Spawn base actor at the spawnpoint and support units in an annulus around the base actor. Both are defined at MPStartUnits. Attach this to the world actor.")] - public class SpawnStartingUnitsInfo : TraitInfo, Requires, ILobbyOptions + public class SpawnStartingUnitsInfo : TraitInfo, Requires, NotBefore, ILobbyOptions { public readonly string StartingUnitsClass = "none";