Skip to content

Commit 14c09b0

Browse files
committed
online_sorter: fix double current map in vote
1 parent 02ad86b commit 14c09b0

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

cstrike/addons/amxmodx/scripting/map_manager_online_sorter.sma

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#include <map_manager>
33

44
#define PLUGIN "Map Manager: Online sorter"
5-
#define VERSION "0.0.3"
5+
#define VERSION "0.0.4"
66
#define AUTHOR "Mistrick"
77

88
#pragma semicolon 1
@@ -16,13 +16,18 @@ enum Cvars {
1616
new g_pCvars[Cvars];
1717

1818
new Array:g_aMapsList;
19+
new g_sCurMap[MAPNAME_LENGTH];
1920

2021
public plugin_init()
2122
{
2223
register_plugin(PLUGIN, VERSION + VERSION_HASH, AUTHOR);
2324

2425
g_pCvars[CHECK_NOMINATED_MAPS] = register_cvar("mapm_sort_check_nominated_maps", "0"); // 0 - disable, 1 - enable
2526
}
27+
public plugin_natives()
28+
{
29+
get_mapname(g_sCurMap, charsmax(g_sCurMap));
30+
}
2631
public mapm_maplist_loaded(Array:maplist)
2732
{
2833
g_aMapsList = maplist;
@@ -41,6 +46,9 @@ public mapm_prepare_votelist(type)
4146
for(new i; i < size; i++) {
4247
ArrayGetArray(g_aMapsList, i, map_info);
4348
if(map_info[MinPlayers] <= players_num <= map_info[MaxPlayers]) {
49+
if(equali(map_info[Map], g_sCurMap)) {
50+
continue;
51+
}
4452
ArrayPushString(array, map_info[Map]);
4553
}
4654
}

0 commit comments

Comments
 (0)