diff --git a/code/_helpers/lists.dm b/code/_helpers/lists.dm index f8a4b12b96..a6d5ea89af 100644 --- a/code/_helpers/lists.dm +++ b/code/_helpers/lists.dm @@ -48,9 +48,7 @@ proc/listgetindex(var/list/list,index) return proc/islist(list/list) - if(istype(list)) - return 1 - return 0 + return(istype(list)) //Return either pick(list) or null if list is not of type /list or is empty proc/safepick(list/list) diff --git a/code/modules/random_map/random_map.dm b/code/modules/random_map/random_map.dm index f1d7d02637..72d52ae4d0 100644 --- a/code/modules/random_map/random_map.dm +++ b/code/modules/random_map/random_map.dm @@ -68,13 +68,11 @@ var/global/list/map_count = list() if(!do_not_announce) admin_notice("[capitalize(name)] failed to generate ([round(0.1*(world.timeofday-start_time),0.1)] seconds): could not produce sane map.", R_DEBUG) /datum/random_map/proc/get_map_cell(var/x,var/y) - if(!islist(map)) + if(!map) set_map_size() - var/cell = ((y-1)*limit_x)+x - if((cell < 1) || (cell > map.len)) + . = ((y-1)*limit_x)+x + if((. < 1) || (. > map.len)) return null - else - return cell /datum/random_map/proc/get_map_char(var/value) switch(value)