From 470d878c456122033e5afee493d04cdb7d16be34 Mon Sep 17 00:00:00 2001 From: Anton Tarasenko Date: Wed, 8 Mar 2023 02:52:53 +0700 Subject: [PATCH] Add "includeMaps" config variable into `BaseGameMode` --- sources/GameModes/BaseGameMode.uc | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/sources/GameModes/BaseGameMode.uc b/sources/GameModes/BaseGameMode.uc index 3b7a017..7b45f1e 100644 --- a/sources/GameModes/BaseGameMode.uc +++ b/sources/GameModes/BaseGameMode.uc @@ -44,6 +44,8 @@ var protected config array includeFeature; // `Feature`s to exclude from game mode, regardless of other settings // (this one has highest priority) var protected config array excludeFeature; +// Lists of maps to include for this game mode +var protected config array includeMaps; struct FeatureConfigPair { @@ -75,17 +77,23 @@ protected function HashTable ToData() _.memory.Free(nextArray); nextArray = _.collections.EmptyArrayList(); for (i = 0; i < excludeFeature.length; i += 1) { - nextArray.AddItem(_.text.FromString(excludeFeature[i])); + nextArray.AddString(excludeFeature[i]); } result.SetItem(P("excludeFeature"), nextArray); _.memory.Free(nextArray); nextArray = _.collections.EmptyArrayList(); for (i = 0; i < includeMutator.length; i += 1) { - nextArray.AddItem(_.text.FromString(includeFeature[i])); + nextArray.AddString(includeFeature[i]); } result.SetItem(P("includeMutator"), nextArray); _.memory.Free(nextArray); nextArray = _.collections.EmptyArrayList(); + for (i = 0; i < includeMaps.length; i += 1) { + nextArray.AddString(includeMaps[i]); + } + result.SetItem(P("includeMaps"), nextArray); + _.memory.Free(nextArray); + nextArray = _.collections.EmptyArrayList(); for (i = 0; i < includeFeatureAs.length; i += 1) { nextPair = _.collections.EmptyHashTable(); @@ -120,6 +128,9 @@ protected function FromData(HashTable source) nextArray = source.GetArrayList(P("includeMutator")); includeMutator = DynamicIntoStringArray(nextArray); _.memory.Free(nextArray); + nextArray = source.GetArrayList(P("includeMaps")); + includeMaps = DynamicIntoStringArray(nextArray); + _.memory.Free(nextArray); nextArray = source.GetArrayList(P("includeFeatureAs")); if (nextArray == none) { return;