From 14181d04d16e6c38ffdf2da4eeb796f7780b4c61 Mon Sep 17 00:00:00 2001 From: Louve <33836535+Rackover@users.noreply.github.com> Date: Wed, 27 Jul 2022 10:54:36 +0200 Subject: [PATCH] =?UTF-8?q?Require=20teamzones=20when=20there's=20no=20are?= =?UTF-8?q?na=20entry=20(fixes=20sp=20maps=20missing=20=E2=80=A6=20(#391)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Require teamzones when there's no arena entry (fixes sp maps missing teams) * Move requireteamzones=true to method Co-authored-by: rackover --- src/Components/Modules/Maps.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Components/Modules/Maps.cpp b/src/Components/Modules/Maps.cpp index 54931bc8..39ef37c3 100644 --- a/src/Components/Modules/Maps.cpp +++ b/src/Components/Modules/Maps.cpp @@ -340,11 +340,17 @@ namespace Components Maps::MapDependencies dependencies{}; + // True by default - cause some maps won't have an arenafile entry + dependencies.requiresTeamZones = true; + for (int i = 0; i < *Game::arenaCount; ++i) { Game::newMapArena_t* arena = &ArenaLength::NewArenas[i]; if (arena->mapName == map) { + // If it's in the arena file, surely it's a vanilla map that doesn't need teams... + dependencies.requiresTeamZones = false; + for (std::size_t j = 0; j < std::extent_v; ++j) { const auto* key = arena->keys[j]; @@ -363,6 +369,7 @@ namespace Components } else if (key == "useteamzones"s) { + // ... unless it specifies so! This allows loading of CODO/COD4 zones that might not have the correct teams dependencies.requiresTeamZones = Utils::String::ToLower(value) == "true"s; } }