Skip to content

Commit

Permalink
Update basetriggers.sp for Dystopia compatibility (#2075)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
bauxiteDYS committed Nov 6, 2023
1 parent d4da21b commit f2ca671
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions plugins/basetriggers.sp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -90,16 +91,25 @@ public void OnPluginStart()
{
g_Cvar_FriendlyFire = FindConVar("mp_friendlyfire");
}


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("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)
{
Expand Down Expand Up @@ -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));
Expand Down

0 comments on commit f2ca671

Please sign in to comment.