mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-22 04:30:44 +01:00
cleanup _HELPERS/_lists.dm and all the necessary files (#61827)
Bring _HELPERS/_lists.dm to latest standards by: -Adding proper documentation and fixing existing one -Giving vars proper names -Procs now use snake case as per standard (many files that use those procs will be affected)
This commit is contained in:
@@ -63,7 +63,7 @@ SUBSYSTEM_DEF(blackbox)
|
||||
//no touchie
|
||||
/datum/controller/subsystem/blackbox/vv_get_var(var_name)
|
||||
if(var_name == "feedback")
|
||||
return debug_variable(var_name, deepCopyList(feedback), 0, src)
|
||||
return debug_variable(var_name, deep_copy_list(feedback), 0, src)
|
||||
return ..()
|
||||
|
||||
/datum/controller/subsystem/blackbox/vv_edit_var(var_name, var_value)
|
||||
|
||||
@@ -49,6 +49,6 @@ PROCESSING_SUBSYSTEM_DEF(dcs)
|
||||
fullid += "[key]"
|
||||
|
||||
if(length(named_arguments))
|
||||
named_arguments = sortList(named_arguments)
|
||||
named_arguments = sort_list(named_arguments)
|
||||
fullid += named_arguments
|
||||
return list2params(fullid)
|
||||
|
||||
@@ -366,7 +366,7 @@ GLOBAL_LIST_EMPTY(the_station_areas)
|
||||
if(pmv)
|
||||
mapvotes[map] = mapvotes[map]*VM.voteweight
|
||||
|
||||
var/pickedmap = pickweight(mapvotes)
|
||||
var/pickedmap = pick_weight(mapvotes)
|
||||
if (!pickedmap)
|
||||
return
|
||||
var/datum/map_config/VM = global.config.maplist[pickedmap]
|
||||
@@ -408,7 +408,7 @@ GLOBAL_LIST_EMPTY(the_station_areas)
|
||||
banned += generateMapList("[global.config.directory]/spaceruinblacklist.txt")
|
||||
banned += generateMapList("[global.config.directory]/iceruinblacklist.txt")
|
||||
|
||||
for(var/item in sortList(subtypesof(/datum/map_template/ruin), /proc/cmp_ruincost_priority))
|
||||
for(var/item in sort_list(subtypesof(/datum/map_template/ruin), /proc/cmp_ruincost_priority))
|
||||
var/datum/map_template/ruin/ruin_type = item
|
||||
// screen out the abstract subtypes
|
||||
if(!initial(ruin_type.id))
|
||||
|
||||
@@ -138,7 +138,7 @@ SUBSYSTEM_DEF(materials)
|
||||
fullid += "[key]"
|
||||
|
||||
if(length(named_arguments))
|
||||
named_arguments = sortList(named_arguments)
|
||||
named_arguments = sort_list(named_arguments)
|
||||
fullid += named_arguments
|
||||
return list2params(fullid)
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ PROCESSING_SUBSYSTEM_DEF(quirks)
|
||||
|
||||
/datum/controller/subsystem/processing/quirks/proc/SetupQuirks()
|
||||
// Sort by Positive, Negative, Neutral; and then by name
|
||||
var/list/quirk_list = sortList(subtypesof(/datum/quirk), /proc/cmp_quirk_asc)
|
||||
var/list/quirk_list = sort_list(subtypesof(/datum/quirk), /proc/cmp_quirk_asc)
|
||||
|
||||
for(var/type in quirk_list)
|
||||
var/datum/quirk/quirk_type = type
|
||||
|
||||
@@ -69,7 +69,7 @@ PROCESSING_SUBSYSTEM_DEF(station)
|
||||
if(!amount)
|
||||
return
|
||||
for(var/iterator in 1 to amount)
|
||||
var/datum/station_trait/trait_type = pickweight(selectable_traits_by_types[trait_sign]) //Rolls from the table for the specific trait type
|
||||
var/datum/station_trait/trait_type = pick_weight(selectable_traits_by_types[trait_sign]) //Rolls from the table for the specific trait type
|
||||
setup_trait(trait_type)
|
||||
|
||||
///Creates a given trait of a specific type, while also removing any blacklisted ones from the future pool.
|
||||
|
||||
@@ -34,7 +34,7 @@ SUBSYSTEM_DEF(server_maint)
|
||||
|
||||
/datum/controller/subsystem/server_maint/fire(resumed = FALSE)
|
||||
if(!resumed)
|
||||
if(listclearnulls(GLOB.clients))
|
||||
if(list_clear_nulls(GLOB.clients))
|
||||
log_world("Found a null in clients list!")
|
||||
src.currentrun = GLOB.clients.Copy()
|
||||
|
||||
@@ -42,7 +42,7 @@ SUBSYSTEM_DEF(server_maint)
|
||||
|
||||
if(!(position_in_loop % 1)) //If it's a whole number
|
||||
var/listname = lists_to_clear[position_in_loop]
|
||||
if(listclearnulls(lists_to_clear[listname]))
|
||||
if(list_clear_nulls(lists_to_clear[listname]))
|
||||
log_world("Found a null in [listname]!")
|
||||
|
||||
cleanup_ticker++
|
||||
|
||||
@@ -834,7 +834,7 @@ SUBSYSTEM_DEF(shuttle)
|
||||
|
||||
templates[S.port_id]["templates"] += list(L)
|
||||
|
||||
data["templates_tabs"] = sortList(data["templates_tabs"])
|
||||
data["templates_tabs"] = sort_list(data["templates_tabs"])
|
||||
|
||||
data["existing_shuttle"] = null
|
||||
|
||||
|
||||
@@ -466,7 +466,7 @@ SUBSYSTEM_DEF(ticker)
|
||||
return
|
||||
var/hpc = CONFIG_GET(number/hard_popcap)
|
||||
if(!hpc)
|
||||
listclearnulls(queued_players)
|
||||
list_clear_nulls(queued_players)
|
||||
for (var/mob/dead/new_player/NP in queued_players)
|
||||
to_chat(NP, span_userdanger("The alive players limit has been released!<br><a href='?src=[REF(NP)];late_join=override'>[html_encode(">>Join Game<<")]</a>"))
|
||||
SEND_SOUND(NP, sound('sound/misc/notice1.ogg'))
|
||||
@@ -480,7 +480,7 @@ SUBSYSTEM_DEF(ticker)
|
||||
|
||||
switch(queue_delay)
|
||||
if(5) //every 5 ticks check if there is a slot available
|
||||
listclearnulls(queued_players)
|
||||
list_clear_nulls(queued_players)
|
||||
if(living_player_count() < hpc)
|
||||
if(next_in_line?.client)
|
||||
to_chat(next_in_line, span_userdanger("A slot has opened! You have approximately 20 seconds to join. <a href='?src=[REF(next_in_line)];late_join=override'>\>\>Join Game\<\<</a>"))
|
||||
|
||||
@@ -488,7 +488,7 @@ SUBSYSTEM_DEF(timer)
|
||||
/datum/timedevent/proc/bucketJoin()
|
||||
// Generate debug-friendly name for timer
|
||||
var/static/list/bitfield_flags = list("TIMER_UNIQUE", "TIMER_OVERRIDE", "TIMER_CLIENT_TIME", "TIMER_STOPPABLE", "TIMER_NO_HASH_WAIT", "TIMER_LOOP")
|
||||
name = "Timer: [id] (\ref[src]), TTR: [timeToRun], wait:[wait] Flags: [jointext(bitfield2list(flags, bitfield_flags), ", ")], \
|
||||
name = "Timer: [id] (\ref[src]), TTR: [timeToRun], wait:[wait] Flags: [jointext(bitfield_to_list(flags, bitfield_flags), ", ")], \
|
||||
callBack: \ref[callBack], callBack.object: [callBack.object]\ref[callBack.object]([getcallingtype()]), \
|
||||
callBack.delegate:[callBack.delegate]([callBack.arguments ? callBack.arguments.Join(", ") : ""]), source: [source]"
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ SUBSYSTEM_DEF(weather)
|
||||
// start random weather on relevant levels
|
||||
for(var/z in eligible_zlevels)
|
||||
var/possible_weather = eligible_zlevels[z]
|
||||
var/datum/weather/our_event = pickweight(possible_weather)
|
||||
var/datum/weather/our_event = pick_weight(possible_weather)
|
||||
run_weather(our_event, list(text2num(z)))
|
||||
eligible_zlevels -= z
|
||||
var/randTime = rand(3000, 6000)
|
||||
|
||||
Reference in New Issue
Block a user