diff --git a/OpenRA.Mods.RA/Cargo.cs b/OpenRA.Mods.RA/Cargo.cs index 338164558e..64269e2cda 100644 --- a/OpenRA.Mods.RA/Cargo.cs +++ b/OpenRA.Mods.RA/Cargo.cs @@ -23,6 +23,7 @@ namespace OpenRA.Mods.RA public readonly int PipCount = 0; public readonly string[] Types = { }; public readonly int UnloadFacing = 0; + public readonly string[] InitialUnits = { }; public object Create( ActorInitializer init ) { return new Cargo( init, this ); } } @@ -46,6 +47,17 @@ namespace OpenRA.Mods.RA cargo = init.Get().ToList(); totalWeight = cargo.Sum( c => GetWeight(c) ); } + else + { + foreach (var u in info.InitialUnits) + { + var unit = self.World.CreateActor(false, u.ToLowerInvariant(), + new TypeDictionary { new OwnerInit(self.Owner) }); + + if (CanLoad(self, unit)) + Load(self,unit); + } + } } public IEnumerable Orders