a step in the right direction

This commit is contained in:
Pinta
2024-03-25 23:02:43 -04:00
parent 4ace8e4f78
commit 55f5578d5b
13 changed files with 40 additions and 30 deletions
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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)
+3
View File
@@ -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)
+2 -2
View File
@@ -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.
+7 -7
View File
@@ -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, "<span class='boldannounce'>Initializing subsystems...</span>")
// 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)
processing = CONFIG_GET(number/mc_tick_rate/high_pop_mc_tick_rate)
+1 -1
View File
@@ -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())
+1 -1
View File
@@ -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))
// ===
+1 -1
View File
@@ -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))
+16 -9
View File
@@ -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("<span class'danger'>[L]'s hips brush against the doorway...</span>")
to_chat(L, "<span class='danger'>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..</span>")
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, "<span class='danger'>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.</span>")
return
return ..()
else if(L.fatness > 1890)
if(rand(1, 5) == 1)
L.visible_message("<span class'danger'>[L]'s hips brush against the doorway...</span>")
to_chat(L, "<span class='danger'>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..</span>")
return ..()
else
return ..()
/obj/machinery/door/airlock/abandoned
abandoned = TRUE
+2 -2
View File
@@ -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 += "</body></html>"
usr << browse(dat.Join(), "window=roundstatus;size=500x500")
usr << browse(dat.Join(), "window=roundstatus;size=500x500")
@@ -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
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
+2 -2
View File
@@ -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
priority = 1
+1 -1
View File
@@ -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()