Skip to content

Commit

Permalink
advanced_lists: rework lists load
Browse files Browse the repository at this point in the history
  • Loading branch information
Mistrick committed May 15, 2018
1 parent 7dff7fb commit b3b6327
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions addons/amxmodx/scripting/map_manager_adv_lists.sma
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include <map_manager>

#define PLUGIN "Map Manager: Advanced lists"
#define VERSION "0.0.3"
#define VERSION "0.0.4"
#define AUTHOR "Mistrick"

#pragma semicolon 1
Expand Down Expand Up @@ -57,14 +57,14 @@ public native_get_list_name(plugin, params)
ArrayGetArray(g_aLists, item, list_info);
set_string(arg_list_name, list_info[ListName], get_param(arg_size));
}
public native_get_list_array(plugin, params)
public Array:native_get_list_array(plugin, params)
{
enum {
arg_item = 1
};

new item = ArrayGetCell(g_aActiveLists, get_param(arg_item));
return _:g_aMapLists[item];
return g_aMapLists[item];
}
public plugin_cfg()
{
Expand Down Expand Up @@ -107,13 +107,18 @@ public plugin_cfg()
list_info[StopTime] = get_int_time(stop);
}

ArrayPushArray(g_aLists, list_info);

// load maps from file to local list
g_aMapLists[i] = ArrayCreate(MapStruct, 1);
mapm_load_maplist_to_array(g_aMapLists[i], list_info[FileList]);

if(!mapm_load_maplist_to_array(g_aMapLists[i], list_info[FileList])) {
ArrayDestroy(g_aMapLists[i]);
continue;
}

i++;

ArrayPushArray(g_aLists, list_info);

list_info[AnyTime] = false;
list_info[StartTime] = 25 * 60;
list_info[StopTime] = -1;
Expand Down Expand Up @@ -161,7 +166,7 @@ public task_check_list()
}
}

new reload = false;
new bool:reload = false;

if(ArraySize(g_aActiveLists) != ArraySize(temp)) {
reload = true;
Expand Down

0 comments on commit b3b6327

Please sign in to comment.