Skip to content

Commit

Permalink
Feat: rotoblin_allow_map_resets convar now supports co-op
Browse files Browse the repository at this point in the history
  • Loading branch information
raziEiL committed Mar 5, 2021
1 parent 26ee552 commit db34f37
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/r2compmod.sp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ new const String:MAIN_TAG[] = "[Rotoblin]";
#define PLUGIN_SHORTNAME "rotoblin" // Shorter version of the full name, used in file paths, and other things
#define PLUGIN_AUTHOR "Rotoblin Team, raziEiL [disawar1]" // Author of the plugin
#define PLUGIN_DESCRIPTION "A Fresh competitive mod for L4D" // Description of the plugin
#define PLUGIN_VERSION "1.4.2" // http://wiki.eclipse.org/Version_Numbering
#define PLUGIN_VERSION "1.4.3" // http://wiki.eclipse.org/Version_Numbering
#define PLUGIN_URL "https://code.google.com/p/rotoblin2/" // URL associated with the project
#define PLUGIN_CVAR_PREFIX PLUGIN_SHORTNAME // Prefix for cvars
#define PLUGIN_CMD_PREFIX PLUGIN_SHORTNAME // Prefix for cmds
Expand Down
24 changes: 21 additions & 3 deletions src/rotoblin2/rotoblin.AutoLoader.sp
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,31 @@

#define RESETTIME 15.0

enum
{
Map_StartIndex,
Map_EndIndex,
Map_Size
}

static const String:sMapList[][] =
{
"l4d_vs_hospital01_apartment",
"l4d_garage01_alleys",
"l4d_vs_airport01_greenhouse",
"l4d_vs_smalltown01_caves",
"l4d_vs_farm01_hilltop",
"l4d_river01_docks"
"l4d_garage01_alleys",
"l4d_river01_docks",
"l4d_hospital01_apartment",
"l4d_airport01_greenhouse",
"l4d_smalltown01_caves",
"l4d_farm01_hilltop"
};

static const MAP_INDEX[][Map_Size] =
{
{4, 9}, // coop
{0, 5} // vs
};

static Handle:g_hAllowLoader, Handle:g_hAllowMatchReset, Handle:g_hAllowMapReset, Handle:g_fwdOnServerEmpty, Handle:g_hResetTimer;
Expand Down Expand Up @@ -132,7 +149,8 @@ public Action:AL_t_ResetWhenEmpty(Handle:timer)

public Action:AL_t_ChangeMap(Handle:timer)
{
new iMapIndex = GetRandomInt(0, sizeof(sMapList) - 1);
new bool:bVersus = IsVersusMode();
new iMapIndex = GetRandomInt(MAP_INDEX[bVersus][Map_StartIndex], MAP_INDEX[bVersus][Map_EndIndex]);

if (IsMapValid(sMapList[iMapIndex])){

Expand Down

0 comments on commit db34f37

Please sign in to comment.