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
This commit is contained in:
bauxite 2023-11-06 16:10:46 +00:00 committed by GitHub
parent d4da21b07f
commit f2ca671d1f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;
@ -91,16 +92,25 @@ public void OnPluginStart()
g_Cvar_FriendlyFire = FindConVar("mp_friendlyfire");
}
RegConsoleCmd("timeleft", Command_Timeleft);
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);
char folder[64];
GetGameFolderName(folder, sizeof(folder));
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));