diff --git a/OpenRA.Mods.RA/SpawnMapActors.cs b/OpenRA.Mods.RA/SpawnMapActors.cs index 3281636f5b..5f32dbeeee 100644 --- a/OpenRA.Mods.RA/SpawnMapActors.cs +++ b/OpenRA.Mods.RA/SpawnMapActors.cs @@ -8,7 +8,8 @@ */ #endregion -using System.Collections.Generic; +using System.Collections.Generic; +using System.Linq; using OpenRA.Traits; namespace OpenRA.Mods.RA @@ -22,7 +23,12 @@ namespace OpenRA.Mods.RA public void WorldLoaded(World world) { foreach (var actorReference in world.Map.Actors.Value) - { + { + // if there is no real player associated, dont spawn it. + var ownerName = actorReference.Value.InitDict.Get().PlayerName; + if (!world.players.Values.Any(p => p.InternalName == ownerName)) + continue; + var initDict = actorReference.Value.InitDict; initDict.Add(new SkipMakeAnimsInit()); Actors[actorReference.Key] = world.CreateActor(actorReference.Value.Type, initDict); diff --git a/mods/ra_perf/maps/571-testcase.oramap b/mods/ra_perf/maps/571-testcase.oramap new file mode 100644 index 0000000000..49ba76e193 Binary files /dev/null and b/mods/ra_perf/maps/571-testcase.oramap differ diff --git a/mods/ra_perf/maps/597-testcase.oramap b/mods/ra_perf/maps/597-testcase.oramap new file mode 100644 index 0000000000..fc045b73fd Binary files /dev/null and b/mods/ra_perf/maps/597-testcase.oramap differ