diff --git a/code/__HELPERS/icons.dm b/code/__HELPERS/icons.dm index 291ed19c..5b5fb1eb 100644 --- a/code/__HELPERS/icons.dm +++ b/code/__HELPERS/icons.dm @@ -829,7 +829,7 @@ world break layers[current] = current_layer - //sortTim(layers, /proc/cmp_image_layer_asc) + //sortTim(layers, GLOBAL_PROC_REF(cmp_image_layer_asc)) var/icon/add // Icon of overlay being added diff --git a/code/__HELPERS/roundend.dm b/code/__HELPERS/roundend.dm index 4a5a302a..8887ae00 100644 --- a/code/__HELPERS/roundend.dm +++ b/code/__HELPERS/roundend.dm @@ -473,7 +473,7 @@ var/currrent_category var/datum/antagonist/previous_category - sortTim(all_antagonists, /proc/cmp_antag_category) + sortTim(all_antagonists, GLOBAL_PROC_REF(cmp_antag_category)) for(var/datum/antagonist/A in all_antagonists) if(!A.show_in_roundend) diff --git a/code/__HELPERS/sorts/__main.dm b/code/__HELPERS/sorts/__main.dm index 76862281..bb196c35 100644 --- a/code/__HELPERS/sorts/__main.dm +++ b/code/__HELPERS/sorts/__main.dm @@ -140,8 +140,11 @@ GLOBAL_DATUM_INIT(sortInstance, /datum/sortInstance, new()) if(runHi >= hi) return 1 + var/list/L = src.L var/last = fetchElement(L,lo) var/current = fetchElement(L,runHi++) + SEND_TEXT(world.log, "current = [current]") + SEND_TEXT(world.log, "last = [last]") if(call(cmp)(current, last) < 0) while(runHi < hi) diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm index 968a01a5..f761d4d5 100644 --- a/code/__HELPERS/unsorted.dm +++ b/code/__HELPERS/unsorted.dm @@ -572,11 +572,11 @@ Turf and target are separate in case you want to teleport some distance from a t for(var/area/A in world) GLOB.sortedAreas.Add(A) - sortTim(GLOB.sortedAreas, /proc/cmp_name_asc) + sortTim(GLOB.sortedAreas, GLOBAL_PROC_REF(cmp_name_asc)) /area/proc/addSorted() GLOB.sortedAreas.Add(src) - sortTim(GLOB.sortedAreas, /proc/cmp_name_asc) + sortTim(GLOB.sortedAreas, GLOBAL_PROC_REF(cmp_name_asc)) //Takes: Area type as a text string from a variable. //Returns: Instance for the area in the world. diff --git a/code/controllers/master.dm b/code/controllers/master.dm index 76a3b1eb..38f3ca58 100644 --- a/code/controllers/master.dm +++ b/code/controllers/master.dm @@ -78,7 +78,7 @@ GLOBAL_REAL(Master, /datum/controller/master) = new qdel(Master) else var/list/subsytem_types = subtypesof(/datum/controller/subsystem) - sortTim(subsytem_types, /proc/cmp_subsystem_init) + sortTim(subsytem_types, GLOBAL_PROC_REF(cmp_subsystem_init)) for(var/I in subsytem_types) _subsystems += new I Master = src @@ -93,7 +93,7 @@ GLOBAL_REAL(Master, /datum/controller/master) = new /datum/controller/master/Shutdown() processing = FALSE - sortTim(subsystems, /proc/cmp_subsystem_init) + sortTim(subsystems, GLOBAL_PROC_REF(cmp_subsystem_init)) reverseRange(subsystems) for(var/datum/controller/subsystem/ss in subsystems) log_world("Shutting down [ss.name] subsystem...") @@ -179,7 +179,7 @@ GLOBAL_REAL(Master, /datum/controller/master) = new to_chat(world, "Initializing subsystems...") // Sort subsystems by init_order, so they initialize in the correct order. - sortTim(subsystems, /proc/cmp_subsystem_init) + sortTim(subsystems, GLOBAL_PROC_REF(cmp_subsystem_init)) var/start_timeofday = REALTIMEOFDAY // Initialize subsystems. @@ -200,7 +200,7 @@ GLOBAL_REAL(Master, /datum/controller/master) = new SetRunLevel(1) // Sort subsystems by display setting for easy access. - sortTim(subsystems, /proc/cmp_subsystem_display) + sortTim(subsystems, GLOBAL_PROC_REF(cmp_subsystem_display)) // Set world options. world.fps = CONFIG_GET(number/fps) var/initialized_tod = REALTIMEOFDAY @@ -282,9 +282,9 @@ GLOBAL_REAL(Master, /datum/controller/master) = new queue_tail = null //these sort by lower priorities first to reduce the number of loops needed to add subsequent SS's to the queue //(higher subsystems will be sooner in the queue, adding them later in the loop means we don't have to loop thru them next queue add) - sortTim(tickersubsystems, /proc/cmp_subsystem_priority) + sortTim(tickersubsystems, GLOBAL_PROC_REF(cmp_subsystem_priority)) for(var/I in runlevel_sorted_subsystems) - sortTim(runlevel_sorted_subsystems, /proc/cmp_subsystem_priority) + sortTim(I, GLOBAL_PROC_REF(cmp_subsystem_priority)) I += tickersubsystems var/cached_runlevel = current_runlevel @@ -611,4 +611,4 @@ GLOBAL_REAL(Master, /datum/controller/master) = new if (client_count < CONFIG_GET(number/mc_tick_rate/disable_high_pop_mc_mode_amount)) processing = CONFIG_GET(number/mc_tick_rate/base_mc_tick_rate) else if (client_count > CONFIG_GET(number/mc_tick_rate/high_pop_mc_mode_amount)) - processing = CONFIG_GET(number/mc_tick_rate/high_pop_mc_tick_rate) \ No newline at end of file + processing = CONFIG_GET(number/mc_tick_rate/high_pop_mc_tick_rate) diff --git a/code/datums/diseases/advance/advance.dm b/code/datums/diseases/advance/advance.dm index 4db9b933..9f8eca6a 100644 --- a/code/datums/diseases/advance/advance.dm +++ b/code/datums/diseases/advance/advance.dm @@ -98,7 +98,7 @@ advance_diseases += P var/replace_num = advance_diseases.len + 1 - DISEASE_LIMIT //amount of diseases that need to be removed to fit this one if(replace_num > 0) - sortTim(advance_diseases, /proc/cmp_advdisease_resistance_asc) + sortTim(advance_diseases, GLOBAL_PROC_REF(cmp_advdisease_resistance_asc)) for(var/i in 1 to replace_num) var/datum/disease/advance/competition = advance_diseases[i] if(totalTransmittable() > competition.totalResistance()) diff --git a/code/game/area/areas.dm b/code/game/area/areas.dm index c2f7e82f..46ff7a71 100644 --- a/code/game/area/areas.dm +++ b/code/game/area/areas.dm @@ -90,7 +90,7 @@ GLOBAL_LIST_EMPTY(teleportlocs) if (picked && is_station_level(picked.z)) GLOB.teleportlocs[AR.name] = AR if(GLOB.teleportlocs.len) //DON'T TRY TO TIMSORT THINGS THAT HAVE NOTHING. FUCK. - sortTim(GLOB.teleportlocs, /proc/cmp_text_dsc) + sortTim(GLOB.teleportlocs, GLOBAL_PROC_REF(cmp_text_dsc)) // === diff --git a/code/game/machinery/constructable_frame.dm b/code/game/machinery/constructable_frame.dm index a238c4a4..d99e5bb7 100644 --- a/code/game/machinery/constructable_frame.dm +++ b/code/game/machinery/constructable_frame.dm @@ -206,7 +206,7 @@ for(var/obj/item/co in replacer) part_list += co //Sort the parts. This ensures that higher tier items are applied first. - part_list = sortTim(part_list, /proc/cmp_rped_sort) + part_list = sortTim(part_list, GLOBAL_PROC_REF(cmp_rped_sort)) for(var/path in req_components) while(req_components[path] > 0 && (locate(path) in part_list)) diff --git a/code/game/machinery/doors/airlock_types.dm b/code/game/machinery/doors/airlock_types.dm index 6f6d19e4..34107c32 100644 --- a/code/game/machinery/doors/airlock_types.dm +++ b/code/game/machinery/doors/airlock_types.dm @@ -8,7 +8,10 @@ //GS13 stuckage code -obj/machinery/door/airlock/Crossed(mob/living/carbon/L) +/obj/machinery/door/airlock/Crossed(mob/living/carbon/L) + if(!istype(L)) + return ..() + if(L.fatness > 5000) if(rand(1, 3) == 1) L.doorstuck = 1 @@ -17,12 +20,8 @@ obj/machinery/door/airlock/Crossed(mob/living/carbon/L) sleep(100) L.doorstuck = 0 L.Knockdown(1) - return - else if(L.fatness > 1890) - if(rand(1, 5) == 1) - L.visible_message("[L]'s hips brush against the doorway...") - to_chat(L, "As you pass through \the [src], you feel a slight brushing against your hips. The [src] frame accommodates your form, but it's a close fit..") - return + return ..() + else if(L.fatness > 3000) if(rand(1, 5) == 1) L.doorstuck = 1 @@ -31,10 +30,18 @@ obj/machinery/door/airlock/Crossed(mob/living/carbon/L) sleep(55) L.doorstuck = 0 L.Knockdown(1) - return + return ..() if(rand(1, 5) == 5) to_chat(L, "With great effort, you manage to squeeze your massive form through \the [src]. It's a tight fit, but you successfully navigate the narrow opening, barely avoiding getting stuck.") - return + return ..() + + else if(L.fatness > 1890) + if(rand(1, 5) == 1) + L.visible_message("[L]'s hips brush against the doorway...") + to_chat(L, "As you pass through \the [src], you feel a slight brushing against your hips. The [src] frame accommodates your form, but it's a close fit..") + return ..() + else + return ..() /obj/machinery/door/airlock/abandoned abandoned = TRUE diff --git a/code/modules/admin/check_antagonists.dm b/code/modules/admin/check_antagonists.dm index 8cb2a9a4..7b2855b5 100644 --- a/code/modules/admin/check_antagonists.dm +++ b/code/modules/admin/check_antagonists.dm @@ -106,7 +106,7 @@ else sections += T.antag_listing_entry() - sortTim(all_antagonists, /proc/cmp_antag_category) + sortTim(all_antagonists, GLOBAL_PROC_REF(cmp_antag_category)) var/current_category var/list/current_section = list() @@ -212,4 +212,4 @@ dat += build_antag_listing() dat += "" - usr << browse(dat.Join(), "window=roundstatus;size=500x500") \ No newline at end of file + usr << browse(dat.Join(), "window=roundstatus;size=500x500") diff --git a/code/modules/atmospherics/gasmixtures/reactions.dm b/code/modules/atmospherics/gasmixtures/reactions.dm index e83bc0e5..399eb601 100644 --- a/code/modules/atmospherics/gasmixtures/reactions.dm +++ b/code/modules/atmospherics/gasmixtures/reactions.dm @@ -16,7 +16,7 @@ reaction_key = req_gas reaction.major_gas = reaction_key . += reaction - sortTim(., /proc/cmp_gas_reaction) + sortTim(., GLOBAL_PROC_REF(cmp_gas_reaction)) /proc/cmp_gas_reaction(datum/gas_reaction/a, datum/gas_reaction/b) // compares lists of reactions by the maximum priority contained within the list return b.priority - a.priority @@ -446,4 +446,4 @@ //Possibly burning a bit of organic matter through maillard reaction, so a *tiny* bit more heat would be understandable air.temperature += cleaned_air * 0.002 - SSresearch.science_tech.add_point_type(TECHWEB_POINT_TYPE_DEFAULT, cleaned_air*MIASMA_RESEARCH_AMOUNT)//Turns out the burning of miasma is kinda interesting to scientists \ No newline at end of file + SSresearch.science_tech.add_point_type(TECHWEB_POINT_TYPE_DEFAULT, cleaned_air*MIASMA_RESEARCH_AMOUNT)//Turns out the burning of miasma is kinda interesting to scientists diff --git a/code/modules/client/client_colour.dm b/code/modules/client/client_colour.dm index 9628dfe0..c42a3633 100644 --- a/code/modules/client/client_colour.dm +++ b/code/modules/client/client_colour.dm @@ -32,7 +32,7 @@ var/datum/client_colour/CC = new colour_type() client_colours |= CC - sortTim(client_colours, /proc/cmp_clientcolour_priority) + sortTim(client_colours, GLOBAL_PROC_REF(cmp_clientcolour_priority)) update_client_colour() @@ -118,4 +118,4 @@ priority = INFINITY //we can't see colors anyway! /datum/client_colour/monochrome/trance - priority = 1 \ No newline at end of file + priority = 1 diff --git a/code/modules/clothing/chameleon.dm b/code/modules/clothing/chameleon.dm index 8b2a34a0..ec61bb8c 100644 --- a/code/modules/clothing/chameleon.dm +++ b/code/modules/clothing/chameleon.dm @@ -85,7 +85,7 @@ var/datum/outfit/O = path if(initial(O.can_be_admin_equipped)) standard_outfit_options[initial(O.name)] = path - sortTim(standard_outfit_options, /proc/cmp_text_asc) + sortTim(standard_outfit_options, GLOBAL_PROC_REF(cmp_text_asc)) outfit_options = standard_outfit_options /datum/action/chameleon_outfit/Trigger()