Skip to content

Commit 261579f

Browse files
committed
nomination: fix show lists if lists changed
1 parent b3b6327 commit 261579f

1 file changed

Lines changed: 10 additions & 5 deletions

File tree

addons/amxmodx/scripting/map_manager_nomination.sma

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#endif
99

1010
#define PLUGIN "Map Manager: Nomination"
11-
#define VERSION "0.0.6"
11+
#define VERSION "0.0.7"
1212
#define AUTHOR "Mistrick"
1313

1414
#pragma semicolon 1
@@ -314,12 +314,17 @@ public lists_handler(id, menu, item)
314314
return PLUGIN_HANDLED;
315315
}
316316

317-
new item_info[8], item_name[32], access, callback;
318-
menu_item_getinfo(menu, item, access, item_info, charsmax(item_info), item_name, charsmax(item_name), callback);
317+
menu_destroy(menu);
319318

320-
// TODO: make this safe, callback may call after changes in adv list
319+
if(item >= mapm_advl_get_active_lists()) {
320+
clcmd_mapslist(id);
321+
return PLUGIN_HANDLED;
322+
}
323+
324+
new list_name[32];
325+
mapm_advl_get_list_name(item, list_name, charsmax(list_name));
321326
new Array:maplist = mapm_advl_get_list_array(item);
322-
show_nomination_menu(id, maplist, item_name);
327+
show_nomination_menu(id, maplist, list_name);
323328

324329
return PLUGIN_HANDLED;
325330
}

0 commit comments

Comments
 (0)