From d2780382bc1056f4e36942055bc93c681cc71d17 Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Fri, 9 May 2025 19:01:17 +0100 Subject: [PATCH] Remove redundant placeholder world definition. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Gustas Kažukauskas <37534529+punkpun@users.noreply.github.com> --- OpenRA.Game/Primitives/ActorInfoDictionary.cs | 9 +++++++++ mods/cnc-content/mod.yaml | 1 - mods/common-content/rules.yaml | 1 - mods/d2k-content/mod.yaml | 1 - mods/ra-content/mod.yaml | 1 - mods/ts-content/mod.yaml | 1 - 6 files changed, 9 insertions(+), 5 deletions(-) delete mode 100644 mods/common-content/rules.yaml diff --git a/OpenRA.Game/Primitives/ActorInfoDictionary.cs b/OpenRA.Game/Primitives/ActorInfoDictionary.cs index a11d1c2584..74b8285079 100644 --- a/OpenRA.Game/Primitives/ActorInfoDictionary.cs +++ b/OpenRA.Game/Primitives/ActorInfoDictionary.cs @@ -24,6 +24,15 @@ namespace OpenRA ArgumentNullException.ThrowIfNull(dict); this.dict = new Dictionary(dict); + + // Include an empty entry for each system actor to guarantee that + // they will be defined even if not specified in the mod yaml + foreach (var systemActor in Enum.GetValues()) + { + var key = systemActor.ToString().ToLowerInvariant(); + if (!dict.ContainsKey(key)) + this.dict[key] = new ActorInfo(key); + } } public bool ContainsKey(string key) => dict.ContainsKey(key); diff --git a/mods/cnc-content/mod.yaml b/mods/cnc-content/mod.yaml index 720d7eafec..b315d8b1c9 100644 --- a/mods/cnc-content/mod.yaml +++ b/mods/cnc-content/mod.yaml @@ -11,7 +11,6 @@ FileSystem: DefaultFileSystem $cnc-content: cnccontent Rules: - content|rules.yaml Cursors: content|cursors.yaml diff --git a/mods/common-content/rules.yaml b/mods/common-content/rules.yaml deleted file mode 100644 index f10c1b582f..0000000000 --- a/mods/common-content/rules.yaml +++ /dev/null @@ -1 +0,0 @@ -World: diff --git a/mods/d2k-content/mod.yaml b/mods/d2k-content/mod.yaml index c33aac5f5d..1d21728c35 100644 --- a/mods/d2k-content/mod.yaml +++ b/mods/d2k-content/mod.yaml @@ -11,7 +11,6 @@ FileSystem: DefaultFileSystem $d2k-content: d2kcontent Rules: - content|rules.yaml Cursors: content|cursors.yaml diff --git a/mods/ra-content/mod.yaml b/mods/ra-content/mod.yaml index 4059304d2f..aedd7add07 100644 --- a/mods/ra-content/mod.yaml +++ b/mods/ra-content/mod.yaml @@ -11,7 +11,6 @@ FileSystem: DefaultFileSystem $ra-content: racontent Rules: - content|rules.yaml Cursors: content|cursors.yaml diff --git a/mods/ts-content/mod.yaml b/mods/ts-content/mod.yaml index 607e542299..71a938be85 100644 --- a/mods/ts-content/mod.yaml +++ b/mods/ts-content/mod.yaml @@ -11,7 +11,6 @@ FileSystem: DefaultFileSystem $ts-content: tscontent Rules: - content|rules.yaml Cursors: content|cursors.yaml