From 83ededb3cbb302021b05f1c1a97c53b64e5515e5 Mon Sep 17 00:00:00 2001 From: Very Strange Karaulov <62130676+2020karaulov2020@users.noreply.github.com> Date: Wed, 10 Feb 2021 11:09:30 +0300 Subject: [PATCH] Restore default cfg before execute new! Restore default cfg before execute new! --- amxmodx/CoreConfig.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/amxmodx/CoreConfig.cpp b/amxmodx/CoreConfig.cpp index ede4048d..5d2a96ca 100644 --- a/amxmodx/CoreConfig.cpp +++ b/amxmodx/CoreConfig.cpp @@ -263,7 +263,15 @@ void CoreConfig::ExecuteMapConfig() strncopy(mapName, STRING(gpGlobals->mapname), sizeof(mapName)); char *mapPrefix; + + ke::SafeSprintf(cfgPath, sizeof(cfgPath), "%s/%s%s/default.cfg", g_mod_name.chars(), configsDir, MapConfigDir); + if (g_LibSys.IsPathFile(cfgPath)) + { + ke::SafeSprintf(command, sizeof(command), CommandFormat, cfgPath); + SERVER_COMMAND(command); + } + if ((mapPrefix = strtok(mapName, "_"))) { ke::SafeSprintf(cfgPath, sizeof(cfgPath), "%s/%s%s/prefix_%s.cfg", g_mod_name.chars(), configsDir, MapConfigDir, mapPrefix);