Skip to content

Commit dd1f145

Browse files
committed
Exec provided config path without 'cfg/' prefix
Use the config string directly in ServerCommand instead of prepending "cfg/" and formatting a separate path. Updated ExecuteGroupCommands, ExecuteSubgroupCommands, and ExecuteMapCommand to exec the provided config value as-is, allowing full or custom paths and avoiding forced "cfg/" prefix. Also updated the compiled plugin (.smx) to match the script changes.
1 parent f0c3beb commit dd1f145

2 files changed

Lines changed: 3 additions & 9 deletions

File tree

-92 Bytes
Binary file not shown.

addons/sourcemod/scripting/multimode_mapcommands.sp

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -225,9 +225,7 @@ void ExecuteGroupCommands(const char[] gamemode, const char[] map)
225225
g_kvMapcycle.GetString(MAPCYCLE_KEY_CONFIG, config, sizeof(config), "");
226226
if (strlen(config) > 0)
227227
{
228-
char configPath[PLATFORM_MAX_PATH];
229-
Format(configPath, sizeof(configPath), "cfg/%s", config);
230-
ServerCommand("exec \"%s\"", configPath);
228+
ServerCommand("exec \"%s\"", config);
231229
MMC_WriteToLogFile(null, "[MultiMode MapCycle Commands] Executed group config for map %s (group: %s): %s",
232230
map, gamemode, config);
233231
}
@@ -270,9 +268,7 @@ void ExecuteSubgroupCommands(const char[] gamemode, const char[] subgroup, const
270268
g_kvMapcycle.GetString(MAPCYCLE_KEY_CONFIG, config, sizeof(config), "");
271269
if (strlen(config) > 0)
272270
{
273-
char configPath[PLATFORM_MAX_PATH];
274-
Format(configPath, sizeof(configPath), "cfg/%s", config);
275-
ServerCommand("exec \"%s\"", configPath);
271+
ServerCommand("exec \"%s\"", config);
276272
MMC_WriteToLogFile(null, "[MultiMode MapCycle Commands] Executed subgroup config for map %s (group: %s, subgroup: %s): %s",
277273
map, gamemode, subgroup, config);
278274
}
@@ -333,9 +329,7 @@ void ExecuteMapCommand(const char[] gamemode, const char[] subgroup, const char[
333329

334330
if (strlen(config) > 0)
335331
{
336-
char configPath[PLATFORM_MAX_PATH];
337-
Format(configPath, sizeof(configPath), "cfg/%s", config);
338-
ServerCommand("exec \"%s\"", configPath);
332+
ServerCommand("exec \"%s\"", config);
339333
MMC_WriteToLogFile(null, "[MultiMode MapCycle Commands] Executed config for map %s (group: %s, subgroup: %s): %s",
340334
map, gamemode, strlen(subgroup) > 0 ? subgroup : "none", config);
341335
}

0 commit comments

Comments
 (0)