Browse Source

Add "includeMaps" config variable into `BaseGameMode`

pull/2/head
Anton Tarasenko 2 years ago
parent
commit
470d878c45
  1. 15
      sources/GameModes/BaseGameMode.uc

15
sources/GameModes/BaseGameMode.uc

@ -44,6 +44,8 @@ var protected config array<string> includeFeature;
// `Feature`s to exclude from game mode, regardless of other settings // `Feature`s to exclude from game mode, regardless of other settings
// (this one has highest priority) // (this one has highest priority)
var protected config array<string> excludeFeature; var protected config array<string> excludeFeature;
// Lists of maps to include for this game mode
var protected config array<string> includeMaps;
struct FeatureConfigPair struct FeatureConfigPair
{ {
@ -75,17 +77,23 @@ protected function HashTable ToData()
_.memory.Free(nextArray); _.memory.Free(nextArray);
nextArray = _.collections.EmptyArrayList(); nextArray = _.collections.EmptyArrayList();
for (i = 0; i < excludeFeature.length; i += 1) { for (i = 0; i < excludeFeature.length; i += 1) {
nextArray.AddItem(_.text.FromString(excludeFeature[i])); nextArray.AddString(excludeFeature[i]);
} }
result.SetItem(P("excludeFeature"), nextArray); result.SetItem(P("excludeFeature"), nextArray);
_.memory.Free(nextArray); _.memory.Free(nextArray);
nextArray = _.collections.EmptyArrayList(); nextArray = _.collections.EmptyArrayList();
for (i = 0; i < includeMutator.length; i += 1) { for (i = 0; i < includeMutator.length; i += 1) {
nextArray.AddItem(_.text.FromString(includeFeature[i])); nextArray.AddString(includeFeature[i]);
} }
result.SetItem(P("includeMutator"), nextArray); result.SetItem(P("includeMutator"), nextArray);
_.memory.Free(nextArray); _.memory.Free(nextArray);
nextArray = _.collections.EmptyArrayList(); 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) for (i = 0; i < includeFeatureAs.length; i += 1)
{ {
nextPair = _.collections.EmptyHashTable(); nextPair = _.collections.EmptyHashTable();
@ -120,6 +128,9 @@ protected function FromData(HashTable source)
nextArray = source.GetArrayList(P("includeMutator")); nextArray = source.GetArrayList(P("includeMutator"));
includeMutator = DynamicIntoStringArray(nextArray); includeMutator = DynamicIntoStringArray(nextArray);
_.memory.Free(nextArray); _.memory.Free(nextArray);
nextArray = source.GetArrayList(P("includeMaps"));
includeMaps = DynamicIntoStringArray(nextArray);
_.memory.Free(nextArray);
nextArray = source.GetArrayList(P("includeFeatureAs")); nextArray = source.GetArrayList(P("includeFeatureAs"));
if (nextArray == none) { if (nextArray == none) {
return; return;

Loading…
Cancel
Save