From d11cb16e22db210d56450c85b5883bc7846e9efe Mon Sep 17 00:00:00 2001 From: bauxite <149741957+bauxiteDYS@users.noreply.github.com> Date: Fri, 3 Nov 2023 22:26:33 +0000 Subject: [PATCH 1/5] 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. --- plugins/basetriggers.sp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/plugins/basetriggers.sp b/plugins/basetriggers.sp index 1e1920ce67..c9a1d7f297 100644 --- a/plugins/basetriggers.sp +++ b/plugins/basetriggers.sp @@ -90,16 +90,20 @@ public void OnPluginStart() { g_Cvar_FriendlyFire = FindConVar("mp_friendlyfire"); } - + + char folder[64]; + GetGameFolderName(folder, sizeof(folder)); + + if (strcmp(folder, "dystopia") != 0) + { + RegConsoleCmd("nextmap", Command_Nextmap); + } + 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)); + g_Cvar_TimeleftInterval.AddChangeHook(ConVarChange_TimeleftInterval); if (strcmp(folder, "insurgency") == 0) { From dabff9c6db6573e73c1a3693b52d747d52e13b6a Mon Sep 17 00:00:00 2001 From: bauxite <149741957+bauxiteDYS@users.noreply.github.com> Date: Sat, 4 Nov 2023 00:06:48 +0000 Subject: [PATCH 2/5] Update basetriggers.sp --- plugins/basetriggers.sp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/basetriggers.sp b/plugins/basetriggers.sp index c9a1d7f297..6840808a46 100644 --- a/plugins/basetriggers.sp +++ b/plugins/basetriggers.sp @@ -265,6 +265,9 @@ public Action Command_FriendlyFire(int client, int args) public void OnClientSayCommand_Post(int client, const char[] command, const char[] sArgs) { + char folder[64]; + GetGameFolderName(folder, sizeof(folder)); + if (IsChatTrigger()) { } @@ -304,7 +307,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 && strcmp(folder, "dystopia") != 0) { char map[PLATFORM_MAX_PATH]; GetNextMap(map, sizeof(map)); From 187ecba81a5a3ac04f5150412333b18d536cb25c Mon Sep 17 00:00:00 2001 From: bauxite <149741957+bauxiteDYS@users.noreply.github.com> Date: Sat, 4 Nov 2023 23:58:23 +0000 Subject: [PATCH 3/5] Update basetriggers.sp --- plugins/basetriggers.sp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/plugins/basetriggers.sp b/plugins/basetriggers.sp index 6840808a46..e0eda1c1fe 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 isGameDystopia; int g_TotalRounds; @@ -98,6 +99,10 @@ public void OnPluginStart() { RegConsoleCmd("nextmap", Command_Nextmap); } + else + { + isGameDystopia = True; + } RegConsoleCmd("timeleft", Command_Timeleft); RegConsoleCmd("motd", Command_Motd); @@ -265,9 +270,6 @@ public Action Command_FriendlyFire(int client, int args) public void OnClientSayCommand_Post(int client, const char[] command, const char[] sArgs) { - char folder[64]; - GetGameFolderName(folder, sizeof(folder)); - if (IsChatTrigger()) { } @@ -307,7 +309,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 && strcmp(folder, "dystopia") != 0) + else if (strcmp(sArgs, "nextmap", false) == 0 && !isGameDystopia) { char map[PLATFORM_MAX_PATH]; GetNextMap(map, sizeof(map)); From e7e2fb8ddecebb59b597643fdff794b33462b06c Mon Sep 17 00:00:00 2001 From: bauxite <149741957+bauxiteDYS@users.noreply.github.com> Date: Sun, 5 Nov 2023 00:12:20 +0000 Subject: [PATCH 4/5] Update basetriggers.sp --- plugins/basetriggers.sp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/basetriggers.sp b/plugins/basetriggers.sp index e0eda1c1fe..999ffda6e1 100644 --- a/plugins/basetriggers.sp +++ b/plugins/basetriggers.sp @@ -101,7 +101,7 @@ public void OnPluginStart() } else { - isGameDystopia = True; + isGameDystopia = true; } RegConsoleCmd("timeleft", Command_Timeleft); From 07f615b95e8ca075d5e47bd4d17a083c994ffc01 Mon Sep 17 00:00:00 2001 From: bauxite <149741957+bauxiteDYS@users.noreply.github.com> Date: Sun, 5 Nov 2023 00:36:33 +0000 Subject: [PATCH 5/5] Update basetriggers.sp --- plugins/basetriggers.sp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/plugins/basetriggers.sp b/plugins/basetriggers.sp index 999ffda6e1..56fc9adc35 100644 --- a/plugins/basetriggers.sp +++ b/plugins/basetriggers.sp @@ -65,7 +65,7 @@ ConVar g_Cvar_MaxRounds; #define PRINT_TO_ONE 2 /* Print to a single player */ bool mapchooser; -bool isGameDystopia; +bool doNextmap; int g_TotalRounds; @@ -95,13 +95,14 @@ public void OnPluginStart() char folder[64]; GetGameFolderName(folder, sizeof(folder)); - if (strcmp(folder, "dystopia") != 0) + if (strcmp(folder, "dystopia") == 0) { - RegConsoleCmd("nextmap", Command_Nextmap); + doNextmap = false; } else { - isGameDystopia = true; + RegConsoleCmd("nextmap", Command_Nextmap); + doNextmap = true; } RegConsoleCmd("timeleft", Command_Timeleft); @@ -309,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 && !isGameDystopia) + else if (strcmp(sArgs, "nextmap", false) == 0 && doNextmap) { char map[PLATFORM_MAX_PATH]; GetNextMap(map, sizeof(map));