From f2ca671d1ff17c452a9a1dd262c4e1aba1c925c5 Mon Sep 17 00:00:00 2001 From: bauxite <149741957+bauxiteDYS@users.noreply.github.com> Date: Mon, 6 Nov 2023 16:10:46 +0000 Subject: [PATCH] Update basetriggers.sp for Dystopia compatibility (#2075) * Update basetriggers.sp for Dystopia compatibility Dystopia has a built-in command called nextmap which breaks due to the Sourcemod nextmap command. This modification is intended to restore Dystopia compatibility. * Update basetriggers.sp * Update basetriggers.sp * Update basetriggers.sp * Update basetriggers.sp --- plugins/basetriggers.sp | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/plugins/basetriggers.sp b/plugins/basetriggers.sp index 1e1920ce6..56fc9adc3 100644 --- a/plugins/basetriggers.sp +++ b/plugins/basetriggers.sp @@ -65,6 +65,7 @@ ConVar g_Cvar_MaxRounds; #define PRINT_TO_ONE 2 /* Print to a single player */ bool mapchooser; +bool doNextmap; int g_TotalRounds; @@ -90,17 +91,26 @@ public void OnPluginStart() { g_Cvar_FriendlyFire = FindConVar("mp_friendlyfire"); } - - RegConsoleCmd("timeleft", Command_Timeleft); - RegConsoleCmd("nextmap", Command_Nextmap); - RegConsoleCmd("motd", Command_Motd); - RegConsoleCmd("ff", Command_FriendlyFire); - - g_Cvar_TimeleftInterval.AddChangeHook(ConVarChange_TimeleftInterval); char folder[64]; GetGameFolderName(folder, sizeof(folder)); + if (strcmp(folder, "dystopia") == 0) + { + doNextmap = false; + } + else + { + RegConsoleCmd("nextmap", Command_Nextmap); + doNextmap = true; + } + + RegConsoleCmd("timeleft", Command_Timeleft); + RegConsoleCmd("motd", Command_Motd); + RegConsoleCmd("ff", Command_FriendlyFire); + + g_Cvar_TimeleftInterval.AddChangeHook(ConVarChange_TimeleftInterval); + if (strcmp(folder, "insurgency") == 0) { HookEvent("game_newmap", Event_GameStart); @@ -300,7 +310,7 @@ public void OnClientSayCommand_Post(int client, const char[] command, const char PrintToChat(client,"[SM] %t", "Current Map", map); } } - else if (strcmp(sArgs, "nextmap", false) == 0) + else if (strcmp(sArgs, "nextmap", false) == 0 && doNextmap) { char map[PLATFORM_MAX_PATH]; GetNextMap(map, sizeof(map));