From f225a15dd743cd5196591fb2ce8248616a3386d2 Mon Sep 17 00:00:00 2001 From: X0-11 Date: Mon, 3 Jun 2024 17:03:21 +0100 Subject: [PATCH 1/9] 01 --- baystation12.dme | 10 +- code/__defines/MC.dm | 21 +- code/__defines/_tick.dm | 21 + code/__defines/math.dm | 10 - code/__defines/qdel.dm | 6 + code/_global_vars/lists/logs.dm | 2 - code/_global_vars/lists/objects.dm | 4 - code/_global_vars/logging.dm | 4 + code/_global_vars/mobs.dm | 1 - code/_helpers/cmp.dm | 44 +- code/_helpers/global_access.dm | 96 ++- code/_helpers/logging.dm | 7 +- code/_helpers/time.dm | 15 +- code/_helpers/unsorted.dm | 4 +- code/_onclick/hud/action.dm | 4 +- code/controllers/Processes/machinery.dm | 67 -- code/controllers/Processes/mob.dm | 29 - code/controllers/Processes/obj.dm | 39 - code/controllers/autotransfer.dm | 11 +- code/controllers/master.dm | 42 +- code/controllers/subsystem.dm | 4 +- code/controllers/subsystems/garbage.dm | 387 +++++---- code/controllers/subsystems/machines.dm | 180 +++++ .../subsystems/processing/fastprocess.dm | 5 + .../controllers/subsystems/processing/mobs.dm | 13 + code/controllers/subsystems/processing/obj.dm | 2 + .../subsystems/processing/processing.dm | 52 +- code/datums/datum.dm | 8 +- code/datums/repositories/cameras.dm | 6 +- .../endgame/supermatter_cascade/portal.dm | 8 +- code/game/gamemodes/godmode/god_altar.dm | 6 +- code/game/machinery/Beacon.dm | 2 +- code/game/machinery/OpTable.dm | 2 +- code/game/machinery/atmoalter/clamp.dm | 2 +- code/game/machinery/camera/motion.dm | 1 + code/game/machinery/camera/presets.dm | 23 +- code/game/machinery/computer/prisoner.dm | 12 +- code/game/machinery/door_control.dm | 1 + code/game/machinery/machinery.dm | 16 +- code/game/machinery/magnet.dm | 4 +- code/game/machinery/nuclear_bomb.dm | 4 +- code/game/machinery/syndicatebeacon.dm | 6 +- code/game/objects/effects/chem/foam.dm | 6 +- code/game/objects/effects/force_portal.dm | 4 +- code/game/objects/effects/spiders.dm | 4 +- code/game/objects/items/devices/flashlight.dm | 4 + code/game/objects/items/devices/geiger.dm | 9 +- code/game/objects/items/devices/powersink.dm | 15 +- .../objects/items/devices/suit_cooling.dm | 6 +- .../items/devices/suit_sensor_jammer.dm | 8 +- code/game/objects/items/devices/t_scanner.dm | 5 + code/game/objects/items/glassjar.dm | 2 +- .../objects/items/weapons/cigs_lighters.dm | 5 + .../objects/items/weapons/material/ashtray.dm | 2 - .../objects/items/weapons/melee/energy.dm | 9 +- code/game/objects/items/weapons/weaponry.dm | 10 +- code/game/objects/objs.dm | 6 +- code/game/objects/structures/alien/egg.dm | 10 +- code/game/objects/structures/alien/node.dm | 8 +- code/game/world.dm | 736 +++++++++++++++++ code/modules/admin/verbs/debug.dm | 2 +- code/modules/admin/verbs/grief_fixers.dm | 5 +- code/modules/assembly/assembly.dm | 5 +- .../components/binary_devices/pipeturbine.dm | 27 +- .../components/binary_devices/pump.dm | 14 +- .../components/omni_devices/filter.dm | 4 +- .../components/omni_devices/mixer.dm | 4 +- .../components/portables_connector.dm | 2 +- .../atmospherics/components/shutoff.dm | 9 +- .../components/unary/heat_exchanger.dm | 2 +- .../components/unary/oxygen_generator.dm | 2 +- .../components/unary/vent_pump.dm | 12 +- code/modules/atmospherics/components/valve.dm | 7 +- .../atmospherics/datum_pipe_network.dm | 109 ++- code/modules/atmospherics/datum_pipeline.dm | 294 +++---- code/modules/atmospherics/he_pipes.dm | 2 +- code/modules/mining/mint.dm | 22 +- .../mob/living/carbon/human/human_species.dm | 7 +- .../mob/living/carbon/xenobiological/items.dm | 6 +- code/modules/mob/living/life.dm | 2 +- .../simple_animal/friendly/farm_animals.dm | 18 +- code/modules/mob/mob.dm | 13 +- .../mob/observer/freelook/ai/cameranet.dm | 6 +- .../observer/freelook/ai/update_triggers.dm | 2 +- code/modules/mob/observer/virtual/base.dm | 14 +- code/modules/power/pacman2.dm | 2 +- code/modules/power/power.dm | 35 - code/modules/power/powernet.dm | 4 +- code/modules/power/turbine.dm | 19 +- .../projectiles/guns/energy/temperature.dm | 6 +- .../projectiles/guns/launcher/alien.dm | 4 +- .../projectiles/guns/magnetic/magnetic.dm | 8 +- code/modules/research/message_server.dm | 6 +- .../shield_generators/handheld_diffuser.dm | 2 +- code/modules/turbolift/turbolift.dm | 2 +- .../xenoarcheaology/artifacts/artifact.dm | 6 +- code/modules/xenoarcheaology/finds/special.dm | 47 +- .../tools/ano_device_battery.dm | 10 +- code/modules/xenoarcheaology/tools/tools.dm | 10 +- code/world.dm | 741 +----------------- .../generateGlobalVars.bat | 2 +- 101 files changed, 1825 insertions(+), 1699 deletions(-) create mode 100644 code/__defines/_tick.dm delete mode 100644 code/__defines/math.dm delete mode 100644 code/controllers/Processes/machinery.dm delete mode 100644 code/controllers/Processes/mob.dm delete mode 100644 code/controllers/Processes/obj.dm create mode 100644 code/controllers/subsystems/machines.dm create mode 100644 code/controllers/subsystems/processing/fastprocess.dm create mode 100644 code/controllers/subsystems/processing/mobs.dm create mode 100644 code/controllers/subsystems/processing/obj.dm create mode 100644 code/game/world.dm diff --git a/baystation12.dme b/baystation12.dme index 0e93ab261f3bf..40eca682b33b5 100644 --- a/baystation12.dme +++ b/baystation12.dme @@ -20,6 +20,7 @@ #include "code\__datastructures\stack.dm" #include "code\__defines\_compile_options.dm" #include "code\__defines\_planes+layers.dm" +#include "code\__defines\_tick.dm" #include "code\__defines\admin.dm" #include "code\__defines\ai_routing_access.dm" #include "code\__defines\ao.dm" @@ -46,7 +47,6 @@ #include "code\__defines\machinery.dm" #include "code\__defines\mapping.dm" #include "code\__defines\materials.dm" -#include "code\__defines\math.dm" #include "code\__defines\math_physics.dm" #include "code\__defines\MC.dm" #include "code\__defines\misc.dm" @@ -167,9 +167,6 @@ #include "code\controllers\Processes\alarm.dm" #include "code\controllers\Processes\chemistry.dm" #include "code\controllers\Processes\emergencyShuttle.dm" -#include "code\controllers\Processes\machinery.dm" -#include "code\controllers\Processes\mob.dm" -#include "code\controllers\Processes\obj.dm" #include "code\controllers\Processes\radiation.dm" #include "code\controllers\Processes\scheduler.dm" #include "code\controllers\Processes\Shuttle.dm" @@ -190,11 +187,15 @@ #include "code\controllers\subsystems\inactivity.dm" #include "code\controllers\subsystems\legacy.dm" #include "code\controllers\subsystems\lighting.dm" +#include "code\controllers\subsystems\machines.dm" #include "code\controllers\subsystems\profiler.dm" #include "code\controllers\subsystems\sun.dm" #include "code\controllers\subsystems\trade.dm" #include "code\controllers\subsystems\processing\airflow.dm" +#include "code\controllers\subsystems\processing\fastprocess.dm" +#include "code\controllers\subsystems\processing\mobs.dm" #include "code\controllers\subsystems\processing\nano.dm" +#include "code\controllers\subsystems\processing\obj.dm" #include "code\controllers\subsystems\processing\processing.dm" #include "code\controllers\voting\_vote.dm" #include "code\controllers\voting\announce_result.dm" @@ -401,6 +402,7 @@ #include "code\game\shuttle_engines.dm" #include "code\game\sound.dm" #include "code\game\supplyshuttle.dm" +#include "code\game\world.dm" #include "code\game\antagonist\_antagonist_setup.dm" #include "code\game\antagonist\antagonist.dm" #include "code\game\antagonist\antagonist_add.dm" diff --git a/code/__defines/MC.dm b/code/__defines/MC.dm index 067b9a14c21aa..37306805358b5 100644 --- a/code/__defines/MC.dm +++ b/code/__defines/MC.dm @@ -1,9 +1,9 @@ -#define MC_TICK_CHECK ( ( world.tick_usage > Master.current_ticklimit || src.state != SS_RUNNING ) ? pause() : 0 ) +#define MC_TICK_CHECK ( ( TICK_USAGE > Master.current_ticklimit || src.state != SS_RUNNING ) ? pause() : 0 ) #define MC_SPLIT_TICK_INIT(phase_count) var/original_tick_limit = Master.current_ticklimit; var/split_tick_phases = ##phase_count #define MC_SPLIT_TICK \ if(split_tick_phases > 1){\ - Master.current_ticklimit = ((original_tick_limit - world.tick_usage) / split_tick_phases) + world.tick_usage;\ + Master.current_ticklimit = ((original_tick_limit - TICK_USAGE) / split_tick_phases) + TICK_USAGE;\ --split_tick_phases;\ } else {\ Master.current_ticklimit = original_tick_limit;\ @@ -20,17 +20,7 @@ #define NEW_SS_GLOBAL(varname) if(varname != src){if(istype(varname)){Recover();qdel(varname);}varname = src;} /// Register a datum to be processed with a processing subsystem. -#define START_PROCESSING(Processor, Datum) \ -if (Datum.is_processing) {\ - if(Datum.is_processing != #Processor)\ - {\ - crash_with("Failed to start processing. [log_info_line(Datum)] is already being processed by [Datum.is_processing] but queue attempt occured on [#Processor]."); \ - }\ -} else {\ - Datum.is_processing = #Processor;\ - Processor.processing += Datum;\ -} - +#define START_PROCESSING(Processor, Datum) if (!Datum.is_processing) {Datum.is_processing = #Processor;Processor.processing += Datum} /// Unregister a datum with a processing subsystem. #define STOP_PROCESSING(Processor, Datum) \ if(Datum.is_processing) {\ @@ -94,4 +84,9 @@ if(Datum.is_processing) {\ NEW_SS_GLOBAL(SS##X);\ PreInit();\ }\ +/datum/controller/subsystem/processing/##X/Recover() {\ + if(istype(SS##X.processing)) {\ + processing = SS##X.processing; \ + }\ +}\ /datum/controller/subsystem/processing/##X diff --git a/code/__defines/_tick.dm b/code/__defines/_tick.dm new file mode 100644 index 0000000000000..9609333eaf9e9 --- /dev/null +++ b/code/__defines/_tick.dm @@ -0,0 +1,21 @@ +#define TICK_LIMIT_RUNNING 80 +#define TICK_LIMIT_TO_RUN 78 +#define TICK_LIMIT_MC 70 +#define TICK_LIMIT_MC_INIT_DEFAULT 98 + +#define TICK_USAGE world.tick_usage //for general usage +#define TICK_USAGE_REAL world.tick_usage //to be used where the result isn't checked + +#define TICK_CHECK ( TICK_USAGE > Master.current_ticklimit ) +#define CHECK_TICK if TICK_CHECK stoplag() + +//"fancy" math for calculating time in ms from tick_usage percentage and the length of ticks +//percent_of_tick_used * (ticklag * 100(to convert to ms)) / 100(percent ratio) +//collapsed to percent_of_tick_used * tick_lag +#define TICK_DELTA_TO_MS(percent_of_tick_used) ((percent_of_tick_used) * world.tick_lag) +#define TICK_USAGE_TO_MS(starting_tickusage) (TICK_DELTA_TO_MS(TICK_USAGE_REAL - starting_tickusage)) + +//time of day but automatically adjusts to the server going into the next day within the same round. +//for when you need a reliable time number that doesn't depend on byond time. +#define REALTIMEOFDAY (world.timeofday + (MIDNIGHT_ROLLOVER * MIDNIGHT_ROLLOVER_CHECK)) +#define MIDNIGHT_ROLLOVER_CHECK ( GLOB.rollovercheck_last_timeofday != world.timeofday ? update_midnight_rollover() : GLOB.midnight_rollovers ) diff --git a/code/__defines/math.dm b/code/__defines/math.dm deleted file mode 100644 index 0729a4526de07..0000000000000 --- a/code/__defines/math.dm +++ /dev/null @@ -1,10 +0,0 @@ -//"fancy" math for calculating time in ms from tick_usage percentage and the length of ticks -//percent_of_tick_used * (ticklag * 100(to convert to ms)) / 100(percent ratio) -//collapsed to percent_of_tick_used * tick_lag -#define TICK_DELTA_TO_MS(percent_of_tick_used) ((percent_of_tick_used) * world.tick_lag) -#define TICK_USAGE_TO_MS(starting_tickusage) (TICK_DELTA_TO_MS(world.tick_usage-starting_tickusage)) - -//time of day but automatically adjusts to the server going into the next day within the same round. -//for when you need a reliable time number that doesn't depend on byond time. -#define REALTIMEOFDAY (world.timeofday + (MIDNIGHT_ROLLOVER * MIDNIGHT_ROLLOVER_CHECK)) -#define MIDNIGHT_ROLLOVER_CHECK ( rollovercheck_last_timeofday != world.timeofday ? update_midnight_rollover() : midnight_rollovers ) diff --git a/code/__defines/qdel.dm b/code/__defines/qdel.dm index 4af85f8b2f2b6..48d9a872cd27e 100644 --- a/code/__defines/qdel.dm +++ b/code/__defines/qdel.dm @@ -9,6 +9,12 @@ //if TESTING is enabled, qdel will call this object's find_references() verb. //defines for the gc_destroyed var + +#define GC_QUEUE_PREQUEUE 1 +#define GC_QUEUE_CHECK 2 +#define GC_QUEUE_HARDDELETE 3 +#define GC_QUEUE_COUNT 3 //increase this when adding more steps. + #define GC_QUEUED_FOR_QUEUING -1 #define GC_QUEUED_FOR_HARD_DEL -2 #define GC_CURRENTLY_BEING_QDELETED -3 diff --git a/code/_global_vars/lists/logs.dm b/code/_global_vars/lists/logs.dm index 9ad4f059bf98b..6f79a5103aafe 100644 --- a/code/_global_vars/lists/logs.dm +++ b/code/_global_vars/lists/logs.dm @@ -2,5 +2,3 @@ GLOBAL_LIST_EMPTY(bombers) GLOBAL_LIST_EMPTY(admin_log) GLOBAL_LIST_EMPTY(lastsignalers) // Keeps last 100 signals here in format: "[src] used \ref[src] @ location [src.loc]: [freq]/[code]" GLOBAL_LIST_EMPTY(lawchanges) // Stores who uploaded laws to which silicon-based lifeform, and what the law was. -GLOBAL_VAR(world_runtime_log) -GLOBAL_PROTECT(world_runtime_log) diff --git a/code/_global_vars/lists/objects.dm b/code/_global_vars/lists/objects.dm index 7e46dc3f1fbe4..461aa1603f43b 100644 --- a/code/_global_vars/lists/objects.dm +++ b/code/_global_vars/lists/objects.dm @@ -1,8 +1,5 @@ GLOBAL_DATUM(data_core, /datum/datacore) // Items that ask to be called every cycle. -GLOBAL_LIST_EMPTY(machines) -GLOBAL_LIST_EMPTY(processing_objects) -GLOBAL_LIST_EMPTY(processing_power_items) GLOBAL_LIST_EMPTY(active_diseases) GLOBAL_LIST_EMPTY(med_hud_users) // List of all entities using a medical HUD. GLOBAL_LIST_EMPTY(sec_hud_users) // List of all entities using a security HUD. @@ -10,7 +7,6 @@ GLOBAL_LIST_EMPTY(hud_icon_reference) GLOBAL_LIST_EMPTY(traders) //List of all nearby traders GLOBAL_LIST_EMPTY(listening_objects) // List of objects that need to be able to hear, used to avoid recursive searching through contents. -GLOBAL_LIST_EMPTY(powernets) GLOBAL_LIST_EMPTY(global_mutations) // List of hidden mutation things. diff --git a/code/_global_vars/logging.dm b/code/_global_vars/logging.dm index 15dcfde957048..d0f8ce0fcc70d 100644 --- a/code/_global_vars/logging.dm +++ b/code/_global_vars/logging.dm @@ -13,3 +13,7 @@ var/diary = null GLOBAL_VAR(log_directory) GLOBAL_PROTECT(log_directory) +GLOBAL_VAR(world_runtime_log) +GLOBAL_PROTECT(world_runtime_log) +GLOBAL_VAR(world_qdel_log) +GLOBAL_PROTECT(world_qdel_log) \ No newline at end of file diff --git a/code/_global_vars/mobs.dm b/code/_global_vars/mobs.dm index d52b7050dbeb6..3e7b7289da7d3 100644 --- a/code/_global_vars/mobs.dm +++ b/code/_global_vars/mobs.dm @@ -5,7 +5,6 @@ GLOBAL_LIST_EMPTY(ckey_directory) //all ckeys with associated client GLOBAL_LIST_EMPTY(player_list) //List of all mobs **with clients attached**. Excludes /mob/new_player -GLOBAL_LIST_EMPTY(mob_list) //List of all mobs, including clientless GLOBAL_LIST_EMPTY(human_mob_list) //List of all human mobs and sub-types, including clientless GLOBAL_LIST_EMPTY(silicon_mob_list) //List of all silicon mobs, including clientless GLOBAL_LIST_EMPTY(living_mob_list_) //List of all alive mobs, including clientless. Excludes /mob/new_player diff --git a/code/_helpers/cmp.dm b/code/_helpers/cmp.dm index 71489f8654eef..21fd189491861 100644 --- a/code/_helpers/cmp.dm +++ b/code/_helpers/cmp.dm @@ -1,10 +1,14 @@ -/proc/cmp_numeric_asc(a,b) - return a - b -/proc/cmp_crew_sensor_modifier(var/crew_sensor_modifier/a, var/crew_sensor_modifier/b) +/proc/cmp_appearance_data(var/datum/appearance_data/a, var/datum/appearance_data/b) return b.priority - a.priority -/proc/cmp_appearance_data(var/datum/appearance_data/a, var/datum/appearance_data/b) +/proc/cmp_camera_ctag_asc(var/obj/machinery/camera/a, var/obj/machinery/camera/b) + return sorttext(b.c_tag, a.c_tag) + +/proc/cmp_camera_ctag_dsc(var/obj/machinery/camera/a, var/obj/machinery/camera/b) + return sorttext(a.c_tag, b.c_tag) + +/proc/cmp_crew_sensor_modifier(var/crew_sensor_modifier/a, var/crew_sensor_modifier/b) return b.priority - a.priority /proc/cmp_follow_holder(var/datum/follow_holder/a, var/datum/follow_holder/b) @@ -13,11 +17,41 @@ return a.sort_order - b.sort_order +/proc/cmp_name_or_type_asc(atom/a, atom/b) + return sorttext(istype(b) || ("name" in b.vars) ? b.name : b.type, istype(a) || ("name" in a.vars) ? a.name : a.type) + +/proc/cmp_name_asc(atom/a, atom/b) + return sorttext(b.name, a.name) + +/proc/cmp_name_dsc(atom/a, atom/b) + return sorttext(a.name, b.name) + +/proc/cmp_numeric_asc(a,b) + return a - b + /proc/cmp_subsystem_display(datum/controller/subsystem/a, datum/controller/subsystem/b) return sorttext(b.name, a.name) /proc/cmp_subsystem_init(datum/controller/subsystem/a, datum/controller/subsystem/b) - return b.init_order - a.init_order + var/a_init_order = ispath(a) ? initial(a.init_order) : a.init_order + var/b_init_order = ispath(b) ? initial(b.init_order) : b.init_order + + return b_init_order - a_init_order //uses initial() so it can be used on types /proc/cmp_subsystem_priority(datum/controller/subsystem/a, datum/controller/subsystem/b) return a.priority - b.priority + +/proc/cmp_text_asc(a,b) + return sorttext(b, a) + +/proc/cmp_text_dsc(a,b) + return sorttext(a, b) + +/proc/cmp_qdel_item_time(datum/qdel_item/A, datum/qdel_item/B) + . = B.hard_delete_time - A.hard_delete_time + if (!.) + . = B.destroy_time - A.destroy_time + if (!.) + . = B.failures - A.failures + if (!.) + . = B.qdels - A.qdels diff --git a/code/_helpers/global_access.dm b/code/_helpers/global_access.dm index cf777f7121ed1..d37832d786834 100644 --- a/code/_helpers/global_access.dm +++ b/code/_helpers/global_access.dm @@ -87,12 +87,20 @@ return global.SHOCKIMMUNITYBLOCK; if("SMALLSIZEBLOCK") return global.SMALLSIZEBLOCK; - if("SSatoms") - return global.SSatoms; + if("SSair") + return global.SSair; + if("SSairflow") + return global.SSairflow; if("SSao") return global.SSao; + if("SSatoms") + return global.SSatoms; + if("SSchat") + return global.SSchat; if("SSevent") return global.SSevent; + if("SSfastprocess") + return global.SSfastprocess; if("SSgarbage") return global.SSgarbage; if("SSinactivity") @@ -101,8 +109,14 @@ return global.SSlegacy; if("SSlighting") return global.SSlighting; + if("SSmachines") + return global.SSmachines; + if("SSmobs") + return global.SSmobs; if("SSnano") return global.SSnano; + if("SSobj") + return global.SSobj; if("SSprocessing") return global.SSprocessing; if("SSprofiler") @@ -131,8 +145,6 @@ return global.WALLITEMS; if("XRAYBLOCK") return global.XRAYBLOCK; - if("_all_globals") - return global._all_globals; if("_client_preferences") return global._client_preferences; if("_client_preferences_by_key") @@ -305,8 +317,6 @@ return global.button_sound; if("cable_list") return global.cable_list; - if("cable_list_late_init") - return global.cable_list_late_init; if("cached_icons") return global.cached_icons; if("cached_space") @@ -383,6 +393,8 @@ return global.created; if("crew_repository") return global.crew_repository; + if("csrfz_check") + return global.csrfz_check; if("cult") return global.cult; if("current_date_string") @@ -555,6 +567,8 @@ return global.gravity_is_on; if("gyrotrons") return global.gyrotrons; + if("gzn_check") + return global.gzn_check; if("hadevent") return global.hadevent; if("hair_styles_female_list") @@ -651,6 +665,8 @@ return global.log_end; if("loot_distributor") return global.loot_distributor; + if("lore_accuracy") + return global.lore_accuracy; if("loyalists") return global.loyalists; if("lunchables_drink_reagents_") @@ -663,8 +679,6 @@ return global.lunchables_lunches_; if("lunchables_snacks_") return global.lunchables_snacks_; - if("machinery_sort_required") - return global.machinery_sort_required; if("magazine_icondata_keys") return global.magazine_icondata_keys; if("magazine_icondata_states") @@ -721,8 +735,6 @@ return global.meteors_normal; if("meteors_threatening") return global.meteors_threatening; - if("midnight_rollovers") - return global.midnight_rollovers; if("mil_branches") return global.mil_branches; if("mining_floors") @@ -817,8 +829,6 @@ return global.photo_count; if("pipe_colors") return global.pipe_colors; - if("pipe_networks") - return global.pipe_networks; if("pipe_processing_killed") return global.pipe_processing_killed; if("plant_controller") @@ -921,8 +931,6 @@ return global.robot_inventory; if("robot_modules") return global.robot_modules; - if("rollovercheck_last_timeofday") - return global.rollovercheck_last_timeofday; if("round_progressing") return global.round_progressing; if("round_start_time") @@ -1217,7 +1225,7 @@ return global.xenomorphs; if("zone_blocked") return global.zone_blocked; - + /proc/writeglobal(which, newval) switch(which) if("ALL_ANTIGENS") @@ -1306,12 +1314,20 @@ global.SHOCKIMMUNITYBLOCK=newval; if("SMALLSIZEBLOCK") global.SMALLSIZEBLOCK=newval; - if("SSatoms") - global.SSatoms=newval; + if("SSair") + global.SSair=newval; + if("SSairflow") + global.SSairflow=newval; if("SSao") global.SSao=newval; + if("SSatoms") + global.SSatoms=newval; + if("SSchat") + global.SSchat=newval; if("SSevent") global.SSevent=newval; + if("SSfastprocess") + global.SSfastprocess=newval; if("SSgarbage") global.SSgarbage=newval; if("SSinactivity") @@ -1320,8 +1336,14 @@ global.SSlegacy=newval; if("SSlighting") global.SSlighting=newval; + if("SSmachines") + global.SSmachines=newval; + if("SSmobs") + global.SSmobs=newval; if("SSnano") global.SSnano=newval; + if("SSobj") + global.SSobj=newval; if("SSprocessing") global.SSprocessing=newval; if("SSprofiler") @@ -1350,8 +1372,6 @@ global.WALLITEMS=newval; if("XRAYBLOCK") global.XRAYBLOCK=newval; - if("_all_globals") - global._all_globals=newval; if("_client_preferences") global._client_preferences=newval; if("_client_preferences_by_key") @@ -1524,8 +1544,6 @@ global.button_sound=newval; if("cable_list") global.cable_list=newval; - if("cable_list_late_init") - global.cable_list_late_init=newval; if("cached_icons") global.cached_icons=newval; if("cached_space") @@ -1602,6 +1620,8 @@ global.created=newval; if("crew_repository") global.crew_repository=newval; + if("csrfz_check") + global.csrfz_check=newval; if("cult") global.cult=newval; if("current_date_string") @@ -1774,6 +1794,8 @@ global.gravity_is_on=newval; if("gyrotrons") global.gyrotrons=newval; + if("gzn_check") + global.gzn_check=newval; if("hadevent") global.hadevent=newval; if("hair_styles_female_list") @@ -1870,6 +1892,8 @@ global.log_end=newval; if("loot_distributor") global.loot_distributor=newval; + if("lore_accuracy") + global.lore_accuracy=newval; if("loyalists") global.loyalists=newval; if("lunchables_drink_reagents_") @@ -1882,8 +1906,6 @@ global.lunchables_lunches_=newval; if("lunchables_snacks_") global.lunchables_snacks_=newval; - if("machinery_sort_required") - global.machinery_sort_required=newval; if("magazine_icondata_keys") global.magazine_icondata_keys=newval; if("magazine_icondata_states") @@ -1940,8 +1962,6 @@ global.meteors_normal=newval; if("meteors_threatening") global.meteors_threatening=newval; - if("midnight_rollovers") - global.midnight_rollovers=newval; if("mil_branches") global.mil_branches=newval; if("mining_floors") @@ -2036,8 +2056,6 @@ global.photo_count=newval; if("pipe_colors") global.pipe_colors=newval; - if("pipe_networks") - global.pipe_networks=newval; if("pipe_processing_killed") global.pipe_processing_killed=newval; if("plant_controller") @@ -2140,8 +2158,6 @@ global.robot_inventory=newval; if("robot_modules") global.robot_modules=newval; - if("rollovercheck_last_timeofday") - global.rollovercheck_last_timeofday=newval; if("round_progressing") global.round_progressing=newval; if("round_start_time") @@ -2436,7 +2452,7 @@ global.xenomorphs=newval; if("zone_blocked") global.zone_blocked=newval; - + /var/list/_all_globals=list( "ALL_ANTIGENS", "ANTAG_FREQS", @@ -2481,14 +2497,21 @@ "REMOTEVIEWBLOCK", "SHOCKIMMUNITYBLOCK", "SMALLSIZEBLOCK", - "SSatoms", + "SSair", + "SSairflow", "SSao", + "SSatoms", + "SSchat", "SSevent", + "SSfastprocess", "SSgarbage", "SSinactivity", "SSlegacy", "SSlighting", + "SSmachines", + "SSmobs", "SSnano", + "SSobj", "SSprocessing", "SSprofiler", "SSsun", @@ -2503,7 +2526,6 @@ "UNSC_ranks", "WALLITEMS", "XRAYBLOCK", - "_all_globals", "_client_preferences", "_client_preferences_by_key", "_client_preferences_by_type", @@ -2538,7 +2560,6 @@ "ai_verbs_default", "air_alarm_topic", "air_blocked", - "air_master", "air_processing_killed", "airlock_overlays", "alarm_manager", @@ -2591,7 +2612,6 @@ "breach_burn_descriptors", "button_sound", "cable_list", - "cable_list_late_init", "cached_icons", "cached_space", "camera_alarm", @@ -2630,6 +2650,7 @@ "create_turf_html", "created", "crew_repository", + "csrfz_check", "cult", "current_date_string", "currently_running_tests", @@ -2716,6 +2737,7 @@ "godcult", "gravity_is_on", "gyrotrons", + "gzn_check", "hadevent", "hair_styles_female_list", "hair_styles_list", @@ -2764,13 +2786,13 @@ "lobby_image", "log_end", "loot_distributor", + "lore_accuracy", "loyalists", "lunchables_drink_reagents_", "lunchables_drinks_", "lunchables_ethanol_reagents_", "lunchables_lunches_", "lunchables_snacks_", - "machinery_sort_required", "magazine_icondata_keys", "magazine_icondata_states", "maint_all_access", @@ -2799,7 +2821,6 @@ "meteors_moderate", "meteors_normal", "meteors_threatening", - "midnight_rollovers", "mil_branches", "mining_floors", "mining_walls", @@ -2847,7 +2868,6 @@ "paramslist_cache", "photo_count", "pipe_colors", - "pipe_networks", "pipe_processing_killed", "plant_controller", "plant_seed_sprites", @@ -2899,7 +2919,6 @@ "robot_hud_colours", "robot_inventory", "robot_modules", - "rollovercheck_last_timeofday", "round_progressing", "round_start_time", "roundstart_hour", @@ -3003,7 +3022,6 @@ "tg_self_state", "tg_z_state", "tgui_process", - "tick_multiplier", "ticker", "tickerProcess", "ticket_panels", diff --git a/code/_helpers/logging.dm b/code/_helpers/logging.dm index 47cd8ad039d63..407de37e5293d 100644 --- a/code/_helpers/logging.dm +++ b/code/_helpers/logging.dm @@ -1,4 +1,6 @@ -//print an error message to world.log +//wrapper macros for easier grepping +#define DIRECT_OUTPUT(A, B) A << B +#define WRITE_FILE(file, text) DIRECT_OUTPUT(file, text) // On Linux/Unix systems the line endings are LF, on windows it's CRLF, admins that don't use notepad++ @@ -102,6 +104,9 @@ to_world_log("## UNIT_TEST ##: [text]") log_debug(text) +/proc/log_qdel(text) + WRITE_FILE(GLOB.world_qdel_log, "\[[time_stamp()]]QDEL: [text]") + //This replaces world.log so it displays both in DD and the file /proc/log_world(text) if(config && config.log_runtime) diff --git a/code/_helpers/time.dm b/code/_helpers/time.dm index 9ed53489c8bda..8577c6ff34eac 100644 --- a/code/_helpers/time.dm +++ b/code/_helpers/time.dm @@ -92,21 +92,16 @@ var/round_start_time = 0 next_duration_update = world.time + 1 MINUTES return last_round_duration -//Can be useful for things dependent on process timing -/proc/process_schedule_interval(var/process_name) - var/datum/controller/process/process = processScheduler.getProcess(process_name) - return process.schedule_interval - /hook/startup/proc/set_roundstart_hour() roundstart_hour = pick(2,7,12,17) return 1 -/var/midnight_rollovers = 0 -/var/rollovercheck_last_timeofday = 0 +GLOBAL_VAR_INIT(midnight_rollovers, 0) +GLOBAL_VAR_INIT(rollovercheck_last_timeofday, 0) /proc/update_midnight_rollover() - if (world.timeofday < rollovercheck_last_timeofday) //TIME IS GOING BACKWARDS! - return midnight_rollovers++ - return midnight_rollovers + if (world.timeofday < GLOB.rollovercheck_last_timeofday) //TIME IS GOING BACKWARDS! + return GLOB.midnight_rollovers++ + return GLOB.midnight_rollovers //Increases delay as the server gets more overloaded, //as sleeps aren't cheap and sleeping only to wake up and sleep again is wasteful diff --git a/code/_helpers/unsorted.dm b/code/_helpers/unsorted.dm index 49cbc98190297..34b22d9e2649f 100644 --- a/code/_helpers/unsorted.dm +++ b/code/_helpers/unsorted.dm @@ -1126,12 +1126,14 @@ GLOBAL_DATUM_INIT(dview_mob, /mob/dview, new) see_in_dark = 1e6 + virtual_mob = null + /atom/proc/get_light_and_color(var/atom/origin) if(origin) color = origin.color set_light(origin.light_range, origin.light_power, origin.light_color) -/mob/dview/New() +/mob/dview/Initialize() ..() // We don't want to be in any mob lists; we're a dummy not a mob. GLOB.mob_list -= src diff --git a/code/_onclick/hud/action.dm b/code/_onclick/hud/action.dm index 90f63b733d25c..d40ee164d0166 100644 --- a/code/_onclick/hud/action.dm +++ b/code/_onclick/hud/action.dm @@ -81,8 +81,8 @@ /datum/action/proc/Deactivate() return -///datum/action/proc/Process() -// return +/datum/action/proc/ProcessAction() + return /datum/action/proc/CheckRemoval(mob/living/user) // 1 if action is no longer valid for this mob and should be removed return 0 diff --git a/code/controllers/Processes/machinery.dm b/code/controllers/Processes/machinery.dm deleted file mode 100644 index a935abf7998d0..0000000000000 --- a/code/controllers/Processes/machinery.dm +++ /dev/null @@ -1,67 +0,0 @@ -/var/global/machinery_sort_required = 0 - -/datum/controller/process/machinery/setup() - name = "machinery" - schedule_interval = MACHINERY_TICKRATE SECONDS // See code/__defines/machinery.dm for definition of MACHINERY_TICKRATE. - start_delay = 12 - -/datum/controller/process/machinery/doWork() - internal_sort() - internal_process_pipenets() - internal_process_machinery() - internal_process_power() - internal_process_power_drain() - -/datum/controller/process/machinery/proc/internal_sort() - if(machinery_sort_required) - machinery_sort_required = 0 - GLOB.machines = dd_sortedObjectList(GLOB.machines) - -/datum/controller/process/machinery/proc/internal_process_machinery() - for(last_object in GLOB.machines) - var/obj/machinery/M = last_object - if(M && !QDELETED(M)) - if(M.process() == PROCESS_KILL) - //M.inMachineList = 0 We don't use this debugging function - GLOB.machines.Remove(M) - continue - - if(M && M.use_power) - M.auto_use_power() - - SCHECK - -/datum/controller/process/machinery/proc/internal_process_power() - for(last_object in GLOB.powernets) - var/datum/powernet/powerNetwork = last_object - if(istype(powerNetwork) && !QDELETED(powerNetwork)) - powerNetwork.reset() - SCHECK - continue - - GLOB.powernets.Remove(powerNetwork) - -/datum/controller/process/machinery/proc/internal_process_power_drain() - // Currently only used by powersinks. These items get priority processed before machinery - for(last_object in GLOB.processing_power_items) - var/obj/item/I = last_object - if(!I.pwr_drain()) // 0 = Process Kill, remove from processing list. - GLOB.processing_power_items.Remove(I) - SCHECK - -/datum/controller/process/machinery/proc/internal_process_pipenets() - for(last_object in pipe_networks) - var/datum/pipe_network/pipeNetwork = last_object - if(istype(pipeNetwork) && !QDELETED(pipeNetwork)) - pipeNetwork.process() - SCHECK - continue - - pipe_networks.Remove(pipeNetwork) - -/datum/controller/process/machinery/statProcess() - ..() - stat(null, "[GLOB.machines.len] machine\s") - stat(null, "[GLOB.powernets.len] powernet\s") - stat(null, "[pipe_networks.len] pipenet\s") - stat(null, "[GLOB.processing_power_items.len] power item\s") diff --git a/code/controllers/Processes/mob.dm b/code/controllers/Processes/mob.dm deleted file mode 100644 index 432970af2d7eb..0000000000000 --- a/code/controllers/Processes/mob.dm +++ /dev/null @@ -1,29 +0,0 @@ -/datum/controller/process/mob - var/tmp/datum/updateQueue/updateQueueInstance - -/datum/controller/process/mob/setup() - name = "mob" - schedule_interval = 20 // every 2 seconds - start_delay = 16 - -/datum/controller/process/mob/started() - ..() - if(!GLOB.mob_list) - GLOB.mob_list = list() - -/datum/controller/process/mob/doWork() - for(last_object in GLOB.mob_list) - var/mob/M = last_object - if(istype(M) && !QDELETED(M)) - try - M.Life() - catch(var/exception/e) - catchException(e, M) - SCHECK - else - catchBadType(M) - GLOB.mob_list -= M - -/datum/controller/process/mob/statProcess() - ..() - stat(null, "[GLOB.mob_list.len] mob\s") diff --git a/code/controllers/Processes/obj.dm b/code/controllers/Processes/obj.dm deleted file mode 100644 index afc07ef9b8e7f..0000000000000 --- a/code/controllers/Processes/obj.dm +++ /dev/null @@ -1,39 +0,0 @@ -/datum/controller/process/obj - var/start_obj_time = 0 - var/obj/highest_obj - var/highest_obj_time = 0 - -/datum/controller/process/obj/setup() - name = "obj" - schedule_interval = 20 // every 2 seconds - start_delay = 8 - -/datum/controller/process/obj/started() - ..() - if(!GLOB.processing_objects) - GLOB.processing_objects = list() - -/datum/controller/process/obj/doWork() - for(last_object in GLOB.processing_objects) - var/start_obj_time = world.time - var/datum/O = last_object - var/kill_process = 0 - if(!QDELETED(O)) - try - if(O:process() == PROCESS_KILL) - kill_process = 1 - catch(var/exception/e) - catchException(e, O) - SCHECK - else - catchBadType(O) - GLOB.processing_objects -= O - if(kill_process) - GLOB.processing_objects -= O - var/time_taken = world.time - start_obj_time - if(time_taken > highest_obj_time) - highest_obj = last_object - -/datum/controller/process/obj/statProcess() - ..() - stat(null, "[GLOB.processing_objects.len] object\s") diff --git a/code/controllers/autotransfer.dm b/code/controllers/autotransfer.dm index 1c32039fa3d1f..05ac8232397e4 100644 --- a/code/controllers/autotransfer.dm +++ b/code/controllers/autotransfer.dm @@ -1,19 +1,20 @@ var/datum/controller/transfer_controller/transfer_controller -datum/controller/transfer_controller +/datum/controller/transfer_controller var/timerbuffer = 0 //buffer for time check -datum/controller/transfer_controller/New() +/datum/controller/transfer_controller/New() timerbuffer = config.vote_autotransfer_initial GLOB.processing_objects += src -datum/controller/transfer_controller/Destroy() +/datum/controller/transfer_controller/Destroy() GLOB.processing_objects -= src + . = ..() -datum/controller/transfer_controller/proc/process() +/datum/controller/transfer_controller/proc/process() if (time_till_transfer_vote() <= 0) vote.autotransfer() timerbuffer += config.vote_autotransfer_interval -datum/controller/transfer_controller/proc/time_till_transfer_vote() +/datum/controller/transfer_controller/proc/time_till_transfer_vote() return timerbuffer - round_duration_in_ticks - (1 MINUTE) diff --git a/code/controllers/master.dm b/code/controllers/master.dm index 897d90903effb..0d188fdf6c7e8 100644 --- a/code/controllers/master.dm +++ b/code/controllers/master.dm @@ -18,7 +18,7 @@ GLOBAL_REAL(Master, /datum/controller/master) = new name = "Master" // Are we processing (higher values increase the processing delay by n ticks) - var/processing = 1 + var/processing = TRUE // How many times have we ran var/iteration = 0 @@ -33,8 +33,6 @@ GLOBAL_REAL(Master, /datum/controller/master) = new var/init_time var/tickdrift = 0 - var/list/total_run_times - var/sleep_delta var/make_runtime = 0 @@ -50,6 +48,7 @@ GLOBAL_REAL(Master, /datum/controller/master) = new var/queue_priority_count_bg = 0 //Same, but for background subsystems var/map_loading = FALSE //Are we loading in a new map? + var/list/total_run_times var/current_runlevel //for scheduling different subsystems for different stages of the round var/static/restart_clear = 0 @@ -61,15 +60,19 @@ GLOBAL_REAL(Master, /datum/controller/master) = new var/static/current_ticklimit = TICK_LIMIT_RUNNING /datum/controller/master/New() - // Highlander-style: there can only be one! Kill off the old and replace it with the new. - subsystems = list() total_run_times = list() + // Highlander-style: there can only be one! Kill off the old and replace it with the new. + var/list/_subsystems = list() + subsystems = _subsystems if (Master != src) if (istype(Master)) Recover() qdel(Master) else - init_subtypes(/datum/controller/subsystem, subsystems) + var/list/subsytem_types = subtypesof(/datum/controller/subsystem) + sortTim(subsytem_types, /proc/cmp_subsystem_init) + for(var/I in subsytem_types) + _subsystems += new I Master = src if(!GLOB) @@ -100,7 +103,7 @@ GLOBAL_REAL(Master, /datum/controller/master) = new var/delay = 50 * ++Master.restart_count Master.restart_timeout = world.time + delay Master.restart_clear = world.time + (delay * 2) - Master.processing = 0 //stop ticking this one + Master.processing = FALSE //stop ticking this one try new/datum/controller/master() catch @@ -127,7 +130,8 @@ GLOBAL_REAL(Master, /datum/controller/master) = new var/FireHim = FALSE if(istype(BadBoy)) msg = null - switch(++BadBoy.failure_strikes) + LAZYINITLIST(BadBoy.failure_strikes) + switch(++BadBoy.failure_strikes[BadBoy.type]) if(2) msg = "The [BadBoy.name] subsystem was the last to fire for 2 controller restarts. It will be recovered now and disabled if it happens again." FireHim = TRUE @@ -146,7 +150,7 @@ GLOBAL_REAL(Master, /datum/controller/master) = new total_run_times = Master.total_run_times StartProcessing(10) else - report_progress("The Master Controller is having some issues, we will need to re-initialize EVERYTHING") + to_chat(world,"The Master Controller is having some issues, we will need to re-initialize EVERYTHING") Initialize(20, TRUE) @@ -177,7 +181,7 @@ GLOBAL_REAL(Master, /datum/controller/master) = new current_ticklimit = TICK_LIMIT_RUNNING var/time = (REALTIMEOFDAY - start_timeofday) / 10 - var/msg = "Initializations complete within [time] second[time == 1 ? "" : "s"]!" + var/msg = "Initializations complete within [time] second\s!" report_progress(msg) log_world(msg) @@ -291,7 +295,7 @@ GLOBAL_REAL(Master, /datum/controller/master) = new //if there are mutiple sleeping procs running before us hogging the cpu, we have to run later // because sleeps are processed in the order received, so longer sleeps are more likely to run first - if (world.tick_usage > TICK_LIMIT_MC) + if (TICK_USAGE > TICK_LIMIT_MC) sleep_delta += 2 current_ticklimit = TICK_LIMIT_RUNNING * 0.5 sleep(world.tick_lag * (processing + sleep_delta)) @@ -300,7 +304,7 @@ GLOBAL_REAL(Master, /datum/controller/master) = new sleep_delta = MC_AVERAGE_FAST(sleep_delta, 0) if (last_run + (world.tick_lag * processing) > world.time) sleep_delta += 1 - if (world.tick_usage > (TICK_LIMIT_MC*0.5)) + if (TICK_USAGE > (TICK_LIMIT_MC*0.5)) sleep_delta += 1 if (make_runtime) @@ -408,13 +412,13 @@ GLOBAL_REAL(Master, /datum/controller/master) = new //keep running while we have stuff to run and we haven't gone over a tick // this is so subsystems paused eariler can use tick time that later subsystems never used - while (ran && queue_head && world.tick_usage < TICK_LIMIT_MC) + while (ran && queue_head && TICK_USAGE < TICK_LIMIT_MC) ran = FALSE bg_calc = FALSE current_tick_budget = queue_priority_count queue_node = queue_head while (queue_node) - if (ran && world.tick_usage > TICK_LIMIT_RUNNING) + if (ran && TICK_USAGE > TICK_LIMIT_RUNNING) break queue_node_flags = queue_node.flags @@ -426,7 +430,7 @@ GLOBAL_REAL(Master, /datum/controller/master) = new //(unless we haven't even ran anything this tick, since its unlikely they will ever be able run // in those cases, so we just let them run) if (queue_node_flags & SS_NO_TICK_CHECK) - if (queue_node.tick_usage > TICK_LIMIT_RUNNING - world.tick_usage && ran_non_ticker) + if (queue_node.tick_usage > TICK_LIMIT_RUNNING - TICK_USAGE && ran_non_ticker) queue_node.queued_priority += queue_priority_count * 0.10 queue_priority_count -= queue_node_priority queue_priority_count += queue_node.queued_priority @@ -438,7 +442,7 @@ GLOBAL_REAL(Master, /datum/controller/master) = new current_tick_budget = queue_priority_count_bg bg_calc = TRUE - tick_remaining = TICK_LIMIT_RUNNING - world.tick_usage + tick_remaining = TICK_LIMIT_RUNNING - TICK_USAGE if (current_tick_budget > 0 && queue_node_priority > 0) tick_precentage = tick_remaining / (current_tick_budget / queue_node_priority) @@ -447,7 +451,7 @@ GLOBAL_REAL(Master, /datum/controller/master) = new tick_precentage = max(tick_precentage*0.5, tick_precentage-queue_node.tick_overrun) - current_ticklimit = round(world.tick_usage + tick_precentage) + current_ticklimit = round(TICK_USAGE + tick_precentage) if (!(queue_node_flags & SS_TICKER)) ran_non_ticker = TRUE @@ -458,9 +462,9 @@ GLOBAL_REAL(Master, /datum/controller/master) = new queue_node.state = SS_RUNNING - tick_usage = world.tick_usage + tick_usage = TICK_USAGE var/state = queue_node.ignite(queue_node_paused) - tick_usage = world.tick_usage - tick_usage + tick_usage = TICK_USAGE - tick_usage if (state == SS_RUNNING) state = SS_IDLE diff --git a/code/controllers/subsystem.dm b/code/controllers/subsystem.dm index 8bfe6b30aefdc..115fde688ff09 100644 --- a/code/controllers/subsystem.dm +++ b/code/controllers/subsystem.dm @@ -34,7 +34,7 @@ var/runlevels = RUNLEVELS_DEFAULT //points of the game at which the SS can fire - var/static/failure_strikes = 0 //How many times we suspect this subsystem has crashed the MC, 3 strikes and you're out! + var/static/list/failure_strikes //How many times we suspect a subsystem type has crashed the MC, 3 strikes and you're out! //Do not override /datum/controller/subsystem/New() @@ -197,7 +197,7 @@ if (SS_SLEEPING) . = "S" if (SS_IDLE) - . = " " + . = " " //could be used to postpone a costly subsystem for (default one) var/cycles, cycles //for instance, during cpu intensive operations like explosions diff --git a/code/controllers/subsystems/garbage.dm b/code/controllers/subsystems/garbage.dm index 0f0525e7d5d07..0e463f36f1825 100644 --- a/code/controllers/subsystems/garbage.dm +++ b/code/controllers/subsystems/garbage.dm @@ -1,165 +1,229 @@ SUBSYSTEM_DEF(garbage) name = "Garbage" - priority = SS_PRIORITY_GARBAGE - wait = 5 + priority = 15 + wait = 2 SECONDS flags = SS_POST_FIRE_TIMING|SS_BACKGROUND|SS_NO_INIT runlevels = RUNLEVELS_DEFAULT | RUNLEVEL_LOBBY - var/collection_timeout = 30 SECONDS // deciseconds to wait to let running procs finish before we just say fuck it and force del() the object - var/delslasttick = 0 // number of del()'s we've done this tick - var/gcedlasttick = 0 // number of things that gc'ed last tick + var/list/collection_timeout = list(0, 2 MINUTES, 10 SECONDS) // deciseconds to wait before moving something up in the queue to the next level + + //Stat tracking + var/delslasttick = 0 // number of del()'s we've done this tick + var/gcedlasttick = 0 // number of things that gc'ed last tick var/totaldels = 0 var/totalgcs = 0 var/highest_del_time = 0 var/highest_del_tickusage = 0 - var/list/queue = list() // list of refID's of things that should be garbage collected - // refID's are associated with the time at which they time out and need to be manually del() - // we do this so we aren't constantly locating them and preventing them from being gc'd + var/list/pass_counts + var/list/fail_counts - var/list/tobequeued = list() //We store the references of things to be added to the queue seperately so we can spread out GC overhead over a few ticks + var/list/items = list() // Holds our qdel_item statistics datums - var/list/didntgc = list() // list of all types that have failed to GC associated with the number of times that's happened. - // the types are stored as strings - var/list/sleptDestroy = list() //Same as above but these are paths that slept during their Destroy call + //Queue + var/list/queues - var/list/noqdelhint = list() // list of all types that do not return a QDEL_HINT - // all types that did not respect qdel(A, force=TRUE) and returned one - // of the immortality qdel hints - var/list/noforcerespect = list() -#ifdef TESTING - var/list/qdel_list = list() // list of all types that have been qdel()eted -#endif +/datum/controller/subsystem/garbage/PreInit() + queues = new(GC_QUEUE_COUNT) + pass_counts = new(GC_QUEUE_COUNT) + fail_counts = new(GC_QUEUE_COUNT) + for(var/i in 1 to GC_QUEUE_COUNT) + queues[i] = list() + pass_counts[i] = 0 + fail_counts[i] = 0 -/datum/controller/subsystem/garbage/stat_entry() - var/msg = list() - msg += "Q:[queue.len]|TD:[totaldels]|TG:[totalgcs]|TGR:" - if (!(totaldels+totalgcs)) - msg += "n/a" +/datum/controller/subsystem/garbage/stat_entry(msg) + var/list/counts = list() + for (var/list/L in queues) + counts += length(L) + msg += "Q:[counts.Join(",")]|D:[delslasttick]|G:[gcedlasttick]|" + msg += "GR:" + if (!(delslasttick+gcedlasttick)) + msg += "n/a|" else - msg += "[round((totalgcs/(totaldels+totalgcs))*100, 0.01)]%" + msg += "[round((gcedlasttick/(delslasttick+gcedlasttick))*100, 0.01)]%|" - msg += "|D:[delslasttick]|G:[gcedlasttick]|GR:" - if (!(delslasttick+gcedlasttick)) - msg += "n/a" + msg += "TD:[totaldels]|TG:[totalgcs]|" + if (!(totaldels+totalgcs)) + msg += "n/a|" else - msg += "[round((gcedlasttick/(delslasttick+gcedlasttick))*100, 0.01)]%" - ..(jointext(msg, null)) + msg += "TGR:[round((totalgcs/(totaldels+totalgcs))*100, 0.01)]%" + msg += " P:[pass_counts.Join(",")]" + msg += "|F:[fail_counts.Join(",")]" + ..(msg) /datum/controller/subsystem/garbage/Shutdown() - //Adds the del() log to world.log in a format condensable by the runtime condenser found in tools - if(didntgc.len || sleptDestroy.len) - var/list/dellog = list() - for(var/path in didntgc) - dellog += "Path : [path] \n" - dellog += "Failures : [didntgc[path]] \n" - if(path in sleptDestroy) - dellog += "Sleeps : [sleptDestroy[path]] \n" - sleptDestroy -= path - for(var/path in sleptDestroy) - dellog += "Path : [path] \n" - dellog += "Sleeps : [sleptDestroy[path]] \n" - text2file(dellog.Join(), "[GLOB.log_directory]/qdel.log") + //Adds the del() log to the qdel log file + var/list/dellog = list() + + //sort by how long it's wasted hard deleting + sortTim(items, cmp=/proc/cmp_qdel_item_time, associative = TRUE) + for(var/path in items) + var/datum/qdel_item/I = items[path] + dellog += "Path: [path]" + if (I.failures) + dellog += "\tFailures: [I.failures]" + dellog += "\tqdel() Count: [I.qdels]" + dellog += "\tDestroy() Cost: [I.destroy_time]ms" + if (I.hard_deletes) + dellog += "\tTotal Hard Deletes [I.hard_deletes]" + dellog += "\tTime Spent Hard Deleting: [I.hard_delete_time]ms" + if (I.slept_destroy) + dellog += "\tSleeps: [I.slept_destroy]" + if (I.no_respect_force) + dellog += "\tIgnored force: [I.no_respect_force] times" + if (I.no_hint) + dellog += "\tNo hint: [I.no_hint] times" + log_qdel(dellog.Join("\n")) /datum/controller/subsystem/garbage/fire() - HandleToBeQueued() - if(state == SS_RUNNING) - HandleQueue() + //the fact that this resets its processing each fire (rather then resume where it left off) is intentional. + var/queue = GC_QUEUE_PREQUEUE + + while (state == SS_RUNNING) + switch (queue) + if (GC_QUEUE_PREQUEUE) + HandlePreQueue() + queue = GC_QUEUE_PREQUEUE+1 + if (GC_QUEUE_CHECK) + HandleQueue(GC_QUEUE_CHECK) + queue = GC_QUEUE_CHECK+1 + if (GC_QUEUE_HARDDELETE) + HandleQueue(GC_QUEUE_HARDDELETE) + break if (state == SS_PAUSED) //make us wait again before the next run. state = SS_RUNNING //If you see this proc high on the profile, what you are really seeing is the garbage collection/soft delete overhead in byond. //Don't attempt to optimize, not worth the effort. -/datum/controller/subsystem/garbage/proc/HandleToBeQueued() - var/list/tobequeued = src.tobequeued - var/starttime = world.time - var/starttimeofday = world.timeofday - while(tobequeued.len && starttime == world.time && starttimeofday == world.timeofday) - if (MC_TICK_CHECK) - break - var/ref = tobequeued[1] - Queue(ref) - tobequeued.Cut(1, 2) - -/datum/controller/subsystem/garbage/proc/HandleQueue() - delslasttick = 0 - gcedlasttick = 0 - var/time_to_kill = world.time - collection_timeout // Anything qdel() but not GC'd BEFORE this time needs to be manually del() - var/list/queue = src.queue - var/starttime = world.time - var/starttimeofday = world.timeofday - while(queue.len && starttime == world.time && starttimeofday == world.timeofday) +/datum/controller/subsystem/garbage/proc/HandlePreQueue() + var/list/tobequeued = queues[GC_QUEUE_PREQUEUE] + var/static/count = 0 + if (count) + var/c = count + count = 0 //so if we runtime on the Cut, we don't try again. + tobequeued.Cut(1,c+1) + + for (var/ref in tobequeued) + count++ + Queue(ref, GC_QUEUE_PREQUEUE+1) if (MC_TICK_CHECK) break - var/refID = queue[1] + if (count) + tobequeued.Cut(1,count+1) + count = 0 + +/datum/controller/subsystem/garbage/proc/HandleQueue(level = GC_QUEUE_CHECK) + if (level == GC_QUEUE_CHECK) + delslasttick = 0 + gcedlasttick = 0 + var/cut_off_time = world.time - collection_timeout[level] //ignore entries newer then this + var/list/queue = queues[level] + var/static/lastlevel + var/static/count = 0 + if (count) //runtime last run before we could do this. + var/c = count + count = 0 //so if we runtime on the Cut, we don't try again. + var/list/lastqueue = queues[lastlevel] + lastqueue.Cut(1, c+1) + + lastlevel = level + + for (var/refID in queue) if (!refID) - queue.Cut(1, 2) + count++ + if (MC_TICK_CHECK) + break continue var/GCd_at_time = queue[refID] - if(GCd_at_time > time_to_kill) + if(GCd_at_time > cut_off_time) break // Everything else is newer, skip them - queue.Cut(1, 2) - var/datum/A - A = locate(refID) - if (A && A.gc_destroyed == GCd_at_time) // So if something else coincidently gets the same ref, it's not deleted by mistake - #ifdef GC_FAILURE_HARD_LOOKUP - A.find_references() - #endif - - // Something's still referring to the qdel'd object. Kill it. - var/type = A.type - if(!didntgc[type]) - log_debug("GC: -- \ref[A] | [type] was unable to be GC'd and was deleted --") - didntgc[type]++ - - HardDelete(A) - - ++delslasttick - ++totaldels - else + count++ + + var/datum/D + D = locate(refID) + + if (!D || D.gc_destroyed != GCd_at_time) // So if something else coincidently gets the same ref, it's not deleted by mistake ++gcedlasttick ++totalgcs + pass_counts[level]++ + if (MC_TICK_CHECK) + break + continue + + // Something's still referring to the qdel'd object. + fail_counts[level]++ + switch (level) + if (GC_QUEUE_CHECK) + #ifdef GC_FAILURE_HARD_LOOKUP + D.find_references() + #endif + var/type = D.type + var/datum/qdel_item/I = items[type] + if(!I.failures) + crash_with("GC: -- \ref[D] | [type] was unable to be GC'd --") + I.failures++ + if (GC_QUEUE_HARDDELETE) + HardDelete(D) + if (MC_TICK_CHECK) + break + continue + + Queue(D, level+1) -/datum/controller/subsystem/garbage/proc/QueueForQueuing(datum/A) - if (istype(A) && A.gc_destroyed == GC_CURRENTLY_BEING_QDELETED) - tobequeued += A - A.gc_destroyed = GC_QUEUED_FOR_QUEUING + if (MC_TICK_CHECK) + break + if (count) + queue.Cut(1,count+1) + count = 0 + +/datum/controller/subsystem/garbage/proc/PreQueue(datum/D) + if (D.gc_destroyed == GC_CURRENTLY_BEING_QDELETED) + queues[GC_QUEUE_PREQUEUE] += D + D.gc_destroyed = GC_QUEUED_FOR_QUEUING -/datum/controller/subsystem/garbage/proc/Queue(datum/A) - if (isnull(A) || (!isnull(A.gc_destroyed) && A.gc_destroyed >= 0)) +/datum/controller/subsystem/garbage/proc/Queue(datum/D, level = GC_QUEUE_CHECK) + if (isnull(D)) return - if (A.gc_destroyed == GC_QUEUED_FOR_HARD_DEL) - HardDelete(A) + if (D.gc_destroyed == GC_QUEUED_FOR_HARD_DEL) + level = GC_QUEUE_HARDDELETE + if (level > GC_QUEUE_COUNT) + HardDelete(D) return var/gctime = world.time - var/refid = "\ref[A]" - - A.gc_destroyed = gctime + var/refid = "\ref[D]" + D.gc_destroyed = gctime + var/list/queue = queues[level] if (queue[refid]) queue -= refid // Removing any previous references that were GC'd so that the current object will be at the end of the list. queue[refid] = gctime -//this is purely to seperate things profile wise. -/datum/controller/subsystem/garbage/proc/HardDelete(datum/A) +//this is mainly to separate things profile wise. +/datum/controller/subsystem/garbage/proc/HardDelete(datum/D) var/time = world.timeofday - var/tick = world.tick_usage + var/tick = TICK_USAGE var/ticktime = world.time + ++delslasttick + ++totaldels + var/type = D.type + var/refID = "\ref[D]" + + del(D) - var/type = A.type - var/refID = "\ref[A]" + tick = (TICK_USAGE-tick+((world.time-ticktime)/world.tick_lag*100)) - if(Debug2) - message_admins("Error: [type]([refID]) was just hard-deleted.") + var/datum/qdel_item/I = items[type] + + I.hard_deletes++ + I.hard_delete_time += TICK_DELTA_TO_MS(tick) - del(A) - tick = (world.tick_usage-tick+((world.time-ticktime)/world.tick_lag*100)) if (tick > highest_del_tickusage) highest_del_tickusage = tick time = world.timeofday - time @@ -170,42 +234,60 @@ SUBSYSTEM_DEF(garbage) if (time > 10) log_game("Error: [type]([refID]) took longer than 1 second to delete (took [time/10] seconds to delete)") message_admins("Error: [type]([refID]) took longer than 1 second to delete (took [time/10] seconds to delete).") - postpone(time/5) + postpone(time) -/datum/controller/subsystem/garbage/proc/HardQueue(datum/A) - if (istype(A) && A.gc_destroyed == GC_CURRENTLY_BEING_QDELETED) - tobequeued += A - A.gc_destroyed = GC_QUEUED_FOR_HARD_DEL +/datum/controller/subsystem/garbage/proc/HardQueue(datum/D) + if (D.gc_destroyed == GC_CURRENTLY_BEING_QDELETED) + queues[GC_QUEUE_PREQUEUE] += D + D.gc_destroyed = GC_QUEUED_FOR_HARD_DEL /datum/controller/subsystem/garbage/Recover() - if (istype(SSgarbage.queue)) - queue |= SSgarbage.queue - if (istype(SSgarbage.tobequeued)) - tobequeued |= SSgarbage.tobequeued + if (istype(SSgarbage.queues)) + for (var/i in 1 to SSgarbage.queues.len) + queues[i] |= SSgarbage.queues[i] + + +/datum/qdel_item + var/name = "" + var/qdels = 0 //Total number of times it's passed thru qdel. + var/destroy_time = 0 //Total amount of milliseconds spent processing this type's Destroy() + var/failures = 0 //Times it was queued for soft deletion but failed to soft delete. + var/hard_deletes = 0 //Different from failures because it also includes QDEL_HINT_HARDDEL deletions + var/hard_delete_time = 0//Total amount of milliseconds spent hard deleting this type. + var/no_respect_force = 0//Number of times it's not respected force=TRUE + var/no_hint = 0 //Number of times it's not even bother to give a qdel hint + var/slept_destroy = 0 //Number of times it's slept in its destroy + +/datum/qdel_item/New(mytype) + name = "[mytype]" + // Should be treated as a replacement for the 'del' keyword. // Datums passed to this will be given a chance to clean up references to allow the GC to collect them. /proc/qdel(datum/D, force=FALSE) - if(!D) - return if(!istype(D)) - crash_with("qdel() was passed '[log_info_line(D)]'. qdel() can only handle instances of (sub)type /datum.") del(D) return -#ifdef TESTING - SSgarbage.qdel_list += D.type -#endif + var/datum/qdel_item/I = SSgarbage.items[D.type] + if (!I) + I = SSgarbage.items[D.type] = new /datum/qdel_item(D.type) + I.qdels++ + + if(isnull(D.gc_destroyed)) D.gc_destroyed = GC_CURRENTLY_BEING_QDELETED var/start_time = world.time + var/start_tick = world.tick_usage var/hint = D.Destroy(force) // Let our friend know they're about to get fucked up. if(world.time != start_time) - SSgarbage.sleptDestroy[D.type]++ + I.slept_destroy++ + else + I.destroy_time += TICK_USAGE_TO_MS(start_tick) if(!D) return switch(hint) if (QDEL_HINT_QUEUE) //qdel should queue the object for deletion. - SSgarbage.QueueForQueuing(D) + SSgarbage.PreQueue(D) if (QDEL_HINT_IWILLGC) D.gc_destroyed = world.time return @@ -215,34 +297,33 @@ SUBSYSTEM_DEF(garbage) return // Returning LETMELIVE after being told to force destroy // indicates the objects Destroy() does not respect force - if(!SSgarbage.noforcerespect[D.type]) - SSgarbage.noforcerespect[D.type] = D.type + if(!I.no_respect_force) crash_with("WARNING: [D.type] has been force deleted, but is \ returning an immortal QDEL_HINT, indicating it does \ not respect the force flag for qdel(). It has been \ placed in the queue, further instances of this type \ will also be queued.") - SSgarbage.QueueForQueuing(D) + I.no_respect_force++ + + SSgarbage.PreQueue(D) if (QDEL_HINT_HARDDEL) //qdel should assume this object won't gc, and queue a hard delete using a hard reference to save time from the locate() SSgarbage.HardQueue(D) if (QDEL_HINT_HARDDEL_NOW) //qdel should assume this object won't gc, and hard del it post haste. SSgarbage.HardDelete(D) if (QDEL_HINT_FINDREFERENCE)//qdel will, if TESTING is enabled, display all references to this object, then queue the object for deletion. - SSgarbage.QueueForQueuing(D) + SSgarbage.PreQueue(D) #ifdef TESTING D.find_references() #endif else - if(!SSgarbage.noqdelhint[D.type]) - SSgarbage.noqdelhint[D.type] = D.type + if(!I.no_hint) crash_with("WARNING: [D.type] is not returning a qdel hint. It is being placed in the queue. Further instances of this type will also be queued.") - SSgarbage.QueueForQueuing(D) + I.no_hint++ + SSgarbage.PreQueue(D) else if(D.gc_destroyed == GC_CURRENTLY_BEING_QDELETED) CRASH("[D.type] destroy proc was called multiple times, likely due to a qdel loop in the Destroy logic") #ifdef TESTING -/datum/var/running_find_references -/datum/var/last_find_references = 0 /datum/verb/find_refs() set category = "Debug" @@ -256,7 +337,7 @@ SUBSYSTEM_DEF(garbage) running_find_references = type if(usr && usr.client) if(usr.client.running_find_references) - report_progress("CANCELLED search for references to a [usr.client.running_find_references].") + testing("CANCELLED search for references to a [usr.client.running_find_references].") usr.client.running_find_references = null running_find_references = null //restart the garbage collector @@ -275,12 +356,12 @@ SUBSYSTEM_DEF(garbage) if(usr && usr.client) usr.client.running_find_references = type - report_progress("Beginning search for references to a [type].") + testing("Beginning search for references to a [type].") last_find_references = world.time DoSearchVar(GLOB) for(var/datum/thing in world) DoSearchVar(thing, "WorldRef: [thing]") - report_progress("Completed search for references to a [type].") + testing("Completed search for references to a [type].") if(usr && usr.client) usr.client.running_find_references = null running_find_references = null @@ -289,16 +370,6 @@ SUBSYSTEM_DEF(garbage) SSgarbage.can_fire = 1 SSgarbage.next_fire = world.time + world.tick_lag -/client/verb/purge_all_destroyed_objects() - set category = "Debug" - if(SSgarbage) - while(SSgarbage.queue.len) - var/datum/o = locate(SSgarbage.queue[1]) - if(istype(o) && o.gc_destroyed) - del(o) - SSgarbage.totaldels++ - SSgarbage.queue.Cut(1, 2) - /datum/verb/qdel_then_find_references() set category = "Debug" set name = "qdel() then Find References" @@ -309,24 +380,6 @@ SUBSYSTEM_DEF(garbage) if(!running_find_references) find_references(TRUE) -/client/verb/show_qdeleted() - set category = "Debug" - set name = "Show qdel() Log" - set desc = "Render the qdel() log and display it" - - var/dat = "List of things that have been qdel()eted this round

" - - var/tmplist = list() - for(var/elem in SSgarbage.qdel_list) - if(!(elem in tmplist)) - tmplist[elem] = 0 - tmplist[elem]++ - - for(var/path in tmplist) - dat += "[path] - [tmplist[path]] times
" - - show_browser(usr, dat, "window=qdeletedlog") - /datum/proc/DoSearchVar(X, Xname) if(usr && usr.client && !usr.client.running_find_references) return if(istype(X, /datum)) @@ -338,10 +391,10 @@ SUBSYSTEM_DEF(garbage) for(var/varname in D.vars) var/variable = D.vars[varname] if(variable == src) - report_progress("Found [src.type] \ref[src] in [D.type]'s [varname] var. [Xname]") + testing("Found [src.type] \ref[src] in [D.type]'s [varname] var. [Xname]") else if(islist(variable)) if(src in variable) - report_progress("Found [src.type] \ref[src] in [D.type]'s [varname] list var. Global: [Xname]") + testing("Found [src.type] \ref[src] in [D.type]'s [varname] list var. Global: [Xname]") #ifdef GC_FAILURE_HARD_LOOKUP for(var/I in variable) DoSearchVar(I, TRUE) @@ -350,7 +403,7 @@ SUBSYSTEM_DEF(garbage) #endif else if(islist(X)) if(src in X) - report_progress("Found [src.type] \ref[src] in list [Xname].") + testing("Found [src.type] \ref[src] in list [Xname].") #ifdef GC_FAILURE_HARD_LOOKUP for(var/I in X) DoSearchVar(I, Xname + ": list") diff --git a/code/controllers/subsystems/machines.dm b/code/controllers/subsystems/machines.dm new file mode 100644 index 0000000000000..ae1b58ea31ea5 --- /dev/null +++ b/code/controllers/subsystems/machines.dm @@ -0,0 +1,180 @@ +#define SSMACHINES_PIPENETS 1 +#define SSMACHINES_MACHINERY 2 +#define SSMACHINES_POWERNETS 3 +#define SSMACHINES_POWER_OBJECTS 4 + +#define START_PROCESSING_IN_LIST(Datum, List) if (!Datum.is_processing) {Datum.is_processing = "SSmachines.[#List]"; SSmachines.List += Datum} +#define STOP_PROCESSING_IN_LIST(Datum, List) \ +if(Datum.is_processing) {\ + if(SSmachines.List.Remove(Datum)) {\ + Datum.is_processing = null;\ + } else {\ + crash_with("Failed to stop processing. [log_info_line(Datum)] is being processed by [is_processing] and not found in SSmachines.[#List]"); \ + }\ +} + +#define START_PROCESSING_PIPENET(Datum) START_PROCESSING_IN_LIST(Datum, pipenets) +#define STOP_PROCESSING_PIPENET(Datum) STOP_PROCESSING_IN_LIST(Datum, pipenets) + +#define START_PROCESSING_POWERNET(Datum) START_PROCESSING_IN_LIST(Datum, powernets) +#define STOP_PROCESSING_POWERNET(Datum) STOP_PROCESSING_IN_LIST(Datum, powernets) + +#define START_PROCESSING_POWER_OBJECT(Datum) START_PROCESSING_IN_LIST(Datum, power_objects) +#define STOP_PROCESSING_POWER_OBJECT(Datum) STOP_PROCESSING_IN_LIST(Datum, power_objects) + +SUBSYSTEM_DEF(machines) + name = "Machines" + init_order = INIT_ORDER_MACHINES + flags = SS_KEEP_TIMING + runlevels = RUNLEVEL_GAME|RUNLEVEL_POSTGAME + + var/current_step = SSMACHINES_PIPENETS + + var/cost_pipenets = 0 + var/cost_machinery = 0 + var/cost_powernets = 0 + var/cost_power_objects = 0 + + var/list/pipenets = list() + var/list/machinery = list() + var/list/powernets = list() + var/list/power_objects = list() + + var/list/processing + var/list/current_run = list() + +/datum/controller/subsystem/machines/PreInit() + processing = machinery + +/datum/controller/subsystem/machines/Initialize(timeofday) + makepowernets() + fire() + ..() + +#define INTERNAL_PROCESS_STEP(this_step, check_resumed, proc_to_call, cost_var, next_step)\ +if(current_step == this_step || (check_resumed && !resumed)) {\ + timer = TICK_USAGE_REAL;\ + proc_to_call(resumed);\ + cost_var = MC_AVERAGE(cost_var, TICK_DELTA_TO_MS(TICK_USAGE_REAL - timer));\ + if(state != SS_RUNNING){\ + return;\ + }\ + resumed = 0;\ + current_step = next_step;\ +} + +/datum/controller/subsystem/machines/fire(resumed = 0) + var/timer = TICK_USAGE_REAL + + INTERNAL_PROCESS_STEP(SSMACHINES_PIPENETS,TRUE,process_pipenets,cost_pipenets,SSMACHINES_MACHINERY) + INTERNAL_PROCESS_STEP(SSMACHINES_MACHINERY,FALSE,process_machinery,cost_machinery,SSMACHINES_POWERNETS) + INTERNAL_PROCESS_STEP(SSMACHINES_POWERNETS,FALSE,process_powernets,cost_powernets,SSMACHINES_POWER_OBJECTS) + INTERNAL_PROCESS_STEP(SSMACHINES_POWER_OBJECTS,FALSE,process_power_objects,cost_power_objects,SSMACHINES_PIPENETS) + +#undef INTERNAL_PROCESS_STEP + +// rebuild all power networks from scratch - only called at world creation or by the admin verb +// The above is a lie. Turbolifts also call this proc. +/datum/controller/subsystem/machines/proc/makepowernets() + for(var/datum/powernet/PN in powernets) + qdel(PN) + powernets.Cut() + + for(var/obj/structure/cable/PC in cable_list) + if(!PC.powernet) + var/datum/powernet/NewPN = new() + NewPN.add_cable(PC) + propagate_network(PC,PC.powernet) + +/datum/controller/subsystem/machines/stat_entry() + var/msg = list() + msg += "C:{" + msg += "PI:[round(cost_pipenets,1)]|" + msg += "MC:[round(cost_machinery,1)]|" + msg += "PN:[round(cost_powernets,1)]|" + msg += "PO:[round(cost_power_objects,1)]" + msg += "} " + msg += "PI:[pipenets.len]|" + msg += "MC:[machinery.len]|" + msg += "PN:[powernets.len]|" + msg += "PO:[power_objects.len]|" + msg += "MC/MS:[round((cost ? machinery.len/cost : 0),0.1)]" + ..(jointext(msg, null)) + +/datum/controller/subsystem/machines/proc/process_pipenets(resumed = 0) + if (!resumed) + src.current_run = pipenets.Copy() + //cache for sanic speed (lists are references anyways) + var/list/current_run = src.current_run + while(current_run.len) + var/datum/pipe_network/PN = current_run[current_run.len] + current_run.len-- + if(istype(PN) && !QDELETED(PN)) + PN.Process(wait) + else + pipenets.Remove(PN) + PN.is_processing = null + if(MC_TICK_CHECK) + return + +/datum/controller/subsystem/machines/proc/process_machinery(resumed = 0) + if (!resumed) + src.current_run = machinery.Copy() + + var/list/current_run = src.current_run + while(current_run.len) + var/obj/machinery/M = current_run[current_run.len] + current_run.len-- + if(istype(M) && !QDELETED(M) && !(M.Process(wait) == PROCESS_KILL)) + if(M.use_power) + M.auto_use_power() + else + machinery.Remove(M) + M.is_processing = null + if(MC_TICK_CHECK) + return + +/datum/controller/subsystem/machines/proc/process_powernets(resumed = 0) + if (!resumed) + src.current_run = powernets.Copy() + + var/list/current_run = src.current_run + while(current_run.len) + var/datum/powernet/PN = current_run[current_run.len] + current_run.len-- + if(istype(PN) && !QDELETED(PN)) + PN.reset(wait) + else + powernets.Remove(PN) + PN.is_processing = null + if(MC_TICK_CHECK) + return + +/datum/controller/subsystem/machines/proc/process_power_objects(resumed = 0) + if (!resumed) + src.current_run = power_objects.Copy() + + var/list/current_run = src.current_run + while(current_run.len) + var/obj/item/I = current_run[current_run.len] + current_run.len-- + if(!I.pwr_drain(wait)) // 0 = Process Kill, remove from processing list. + power_objects.Remove(I) + I.is_processing = null + if(MC_TICK_CHECK) + return + +/datum/controller/subsystem/machines/Recover() + if (istype(SSmachines.pipenets)) + pipenets = SSmachines.pipenets + if (istype(SSmachines.machinery)) + machinery = SSmachines.machinery + if (istype(SSmachines.powernets)) + powernets = SSmachines.powernets + if (istype(SSmachines.power_objects)) + power_objects = SSmachines.power_objects + +#undef SSMACHINES_PIPENETS +#undef SSMACHINES_MACHINERY +#undef SSMACHINES_POWER +#undef SSMACHINES_power_objects diff --git a/code/controllers/subsystems/processing/fastprocess.dm b/code/controllers/subsystems/processing/fastprocess.dm new file mode 100644 index 0000000000000..c753b97f65e5c --- /dev/null +++ b/code/controllers/subsystems/processing/fastprocess.dm @@ -0,0 +1,5 @@ +//Fires five times every second. + +PROCESSING_SUBSYSTEM_DEF(fastprocess) + name = "Fast Processing" + wait = 2 diff --git a/code/controllers/subsystems/processing/mobs.dm b/code/controllers/subsystems/processing/mobs.dm new file mode 100644 index 0000000000000..1422a819f307a --- /dev/null +++ b/code/controllers/subsystems/processing/mobs.dm @@ -0,0 +1,13 @@ +PROCESSING_SUBSYSTEM_DEF(mobs) + name = "Mobs" + priority = 100 + flags = SS_KEEP_TIMING|SS_NO_INIT + runlevels = RUNLEVEL_GAME|RUNLEVEL_POSTGAME + wait = 20 + + process_proc = /mob/proc/Life + + var/list/mob_list + +/datum/controller/subsystem/processing/mobs/PreInit() + mob_list = processing // Simply setups a more recognizable var name than "processing" diff --git a/code/controllers/subsystems/processing/obj.dm b/code/controllers/subsystems/processing/obj.dm new file mode 100644 index 0000000000000..c6576fadde7c4 --- /dev/null +++ b/code/controllers/subsystems/processing/obj.dm @@ -0,0 +1,2 @@ +PROCESSING_SUBSYSTEM_DEF(obj) + name = "Objs" diff --git a/code/controllers/subsystems/processing/processing.dm b/code/controllers/subsystems/processing/processing.dm index b7ccb19c38577..82c304df33245 100644 --- a/code/controllers/subsystems/processing/processing.dm +++ b/code/controllers/subsystems/processing/processing.dm @@ -2,23 +2,16 @@ SUBSYSTEM_DEF(processing) name = "Processing" - priority = 95 //SS_PRIORITY_PROCESSING + priority = 25 flags = SS_BACKGROUND|SS_POST_FIRE_TIMING|SS_NO_INIT - wait = 1 SECOND + wait = 10 var/list/processing = list() var/list/current_run = list() var/process_proc = /datum/proc/Process - var/debug_last_thing - var/debug_original_process_proc // initial() does not work with procs - - -///datum/controller/subsystem/processing/UpdateStat(time) -// if (PreventUpdateStat(time)) -// return ..() -// ..("Queue [processing.len]") - +/datum/controller/subsystem/processing/stat_entry() + ..(processing.len) /datum/controller/subsystem/processing/fire(resumed = 0) if (!resumed) @@ -31,41 +24,8 @@ SUBSYSTEM_DEF(processing) while(current_run.len) var/datum/thing = current_run[current_run.len] current_run.len-- - if(QDELETED(thing) || (call(thing, process_proc)(wait, times_fired, src) == PROCESS_KILL)) - if(thing) - thing.is_processing = null + if(QDELETED(thing) || (call(thing, process_proc)(wait, times_fired) == PROCESS_KILL)) + thing.is_processing = null processing -= thing if (MC_TICK_CHECK) return - -/datum/controller/subsystem/processing/proc/toggle_debug() - if(!check_rights(R_DEBUG)) - return - - if(debug_original_process_proc) - process_proc = debug_original_process_proc - debug_original_process_proc = null - else - debug_original_process_proc = process_proc - process_proc = /datum/proc/DebugSubsystemProcess - - to_chat(usr, "[name] - Debug mode [debug_original_process_proc ? "en" : "dis"]abled") - -/datum/controller/subsystem/processing/Recover(datum/controller/subsystem/processing/P) - processing = P.processing - -/datum/controller/subsystem/processing/VV_static() - return ..() + list("processing", "current_run", "process_proc", "debug_last_thing", "debug_original_process_proc") - -/datum/proc/DebugSubsystemProcess(wait, times_fired, datum/controller/subsystem/processing/subsystem) - subsystem.debug_last_thing = src - var/start_tick = world.time - var/start_tick_usage = world.tick_usage - . = call(src, subsystem.debug_original_process_proc)(wait, times_fired) - - var/tick_time = world.time - start_tick - var/tick_use_limit = world.tick_usage - start_tick_usage - 100 // Current tick use - starting tick use - 100% (a full tick excess) - if(tick_time > 0) - crash_with("[log_info_line(subsystem.debug_last_thing)] slept during processing. Spent [tick_time] tick\s.") - if(tick_use_limit > 0) - crash_with("[log_info_line(subsystem.debug_last_thing)] took longer than a tick to process. Exceeded with [tick_use_limit]%") \ No newline at end of file diff --git a/code/datums/datum.dm b/code/datums/datum.dm index 847a58fea4044..db0f2f71eb96a 100644 --- a/code/datums/datum.dm +++ b/code/datums/datum.dm @@ -1,14 +1,18 @@ /datum var/tmp/gc_destroyed //Time when this object was destroyed. var/tmp/is_processing = FALSE - var/list/active_timers //for SStimer + +#ifdef TESTING + var/tmp/running_find_references + var/tmp/last_find_references = 0 +#endif // Default implementation of clean-up code. // This should be overridden to remove all references pointing to the object being destroyed. // Return the appropriate QDEL_HINT; in most cases this is QDEL_HINT_QUEUE. /datum/proc/Destroy(force=FALSE) tag = null - SSnano && SSnano.close_uis(src) + GLOB.nanomanager && GLOB.nanomanager.close_uis(src) return QDEL_HINT_QUEUE /datum/proc/Process() diff --git a/code/datums/repositories/cameras.dm b/code/datums/repositories/cameras.dm index aad4984bfea1e..952050b136036 100644 --- a/code/datums/repositories/cameras.dm +++ b/code/datums/repositories/cameras.dm @@ -3,7 +3,7 @@ var/repository/cameras/camera_repository = new() /proc/invalidateCameraCache() camera_repository.networks.Cut() camera_repository.invalidated = 1 - camera_repository.camera_cache_id = (++camera_repository.camera_cache_id % 999999) + camera_repository.camera_cache_id = ++camera_repository.camera_cache_id /repository/cameras var/list/networks @@ -29,10 +29,12 @@ var/repository/cameras/camera_repository = new() for(var/cam in cnet.cameras) all_cams += cam - for(var/obj/machinery/camera/C in all_cams) + for(var/sc in all_cams) + var/obj/machinery/camera/C = sc var/cam = C.nano_structure() for(var/network in C.network) if(!networks[network]) + ADD_SORTED(networks,network,/proc/cmp_text_asc) networks[network] = list() var/list/netlist = networks[network] netlist[++netlist.len] = cam diff --git a/code/game/gamemodes/endgame/supermatter_cascade/portal.dm b/code/game/gamemodes/endgame/supermatter_cascade/portal.dm index 69a579ea71c3c..13d38f79d538c 100644 --- a/code/game/gamemodes/endgame/supermatter_cascade/portal.dm +++ b/code/game/gamemodes/endgame/supermatter_cascade/portal.dm @@ -14,14 +14,14 @@ consume_range = 6 -/obj/singularity/narsie/large/exit/New() - ..() - GLOB.processing_objects.Add(src) +/obj/singularity/narsie/large/exit/Initialize() + . = ..() + START_PROCESSING(SSobj,src) /obj/singularity/narsie/large/exit/update_icon() overlays = 0 -/obj/singularity/narsie/large/exit/process() +/obj/singularity/narsie/large/exit/Process() for(var/mob/M in GLOB.player_list) if(M.client) M.see_rift(src) diff --git a/code/game/gamemodes/godmode/god_altar.dm b/code/game/gamemodes/godmode/god_altar.dm index 7a4b76f613a58..daa4705aef57c 100644 --- a/code/game/gamemodes/godmode/god_altar.dm +++ b/code/game/gamemodes/godmode/god_altar.dm @@ -32,7 +32,7 @@ user.drop_from_inventory(G) else ..() -/obj/structure/deity/altar/process() +/obj/structure/deity/altar/Process() if(!target || world.time < next_cycle) return if(!linked_god || target.stat) @@ -66,7 +66,7 @@ if(target || !linked_god) return cycles_before_converted = initial(cycles_before_converted) - GLOB.processing_objects |= src + START_PROCESSING(SSobj,src) target = L update_icon() GLOB.destroyed_event.register(L,src,/obj/structure/deity/altar/proc/remove_target) @@ -74,7 +74,7 @@ GLOB.death_event.register(L, src, /obj/structure/deity/altar/proc/remove_target) /obj/structure/deity/altar/proc/remove_target() - GLOB.processing_objects -= src + STOP_PROCESSING(SSobj,src) GLOB.destroyed_event.unregister(target, src) GLOB.moved_event.unregister(target, src) GLOB.death_event.unregister(target, src) diff --git a/code/game/machinery/Beacon.dm b/code/game/machinery/Beacon.dm index 878a4ec2e6246..70ae0f7b42c2d 100644 --- a/code/game/machinery/Beacon.dm +++ b/code/game/machinery/Beacon.dm @@ -38,7 +38,7 @@ else icon_state = "[state]" - process() + Process() if(!Beacon) var/turf/T = loc Beacon = new /obj/item/device/radio/beacon diff --git a/code/game/machinery/OpTable.dm b/code/game/machinery/OpTable.dm index 7f48af742ea62..29547cb35887c 100644 --- a/code/game/machinery/OpTable.dm +++ b/code/game/machinery/OpTable.dm @@ -77,7 +77,7 @@ icon_state = "table2-idle" return 0 -/obj/machinery/optable/process() +/obj/machinery/optable/Process() check_victim() /obj/machinery/optable/proc/take_victim(mob/living/carbon/C, mob/living/carbon/user as mob) diff --git a/code/game/machinery/atmoalter/clamp.dm b/code/game/machinery/atmoalter/clamp.dm index a27fe4cbe4067..460c844bb00d3 100644 --- a/code/game/machinery/atmoalter/clamp.dm +++ b/code/game/machinery/atmoalter/clamp.dm @@ -46,7 +46,7 @@ /obj/machinery/clamp/Destroy() if(!open) spawn(-1) open() - ..() + . = ..() /obj/machinery/clamp/proc/open() if(open) diff --git a/code/game/machinery/camera/motion.dm b/code/game/machinery/camera/motion.dm index 3704ea8b3b76e..712c8435cb08a 100644 --- a/code/game/machinery/camera/motion.dm +++ b/code/game/machinery/camera/motion.dm @@ -5,6 +5,7 @@ flags = PROXMOVE /obj/machinery/camera/internal_process() + ..() // motion camera event loop if (stat & (EMPED|NOPOWER)) return diff --git a/code/game/machinery/camera/presets.dm b/code/game/machinery/camera/presets.dm index d7e8ce32b3c9c..9ca966326410c 100644 --- a/code/game/machinery/camera/presets.dm +++ b/code/game/machinery/camera/presets.dm @@ -24,29 +24,29 @@ // EMP -/obj/machinery/camera/emp_proof/New() +/obj/machinery/camera/emp_proof/Initialize() ..() - upgradeEmpProof() + . = upgradeEmpProof() // X-RAY /obj/machinery/camera/xray icon_state = "xraycam" // Thanks to Krutchen for the icons. -/obj/machinery/camera/xray/New() +/obj/machinery/camera/xray/Initialize() ..() - upgradeXRay() + . = upgradeXRay() // MOTION -/obj/machinery/camera/motion/New() +/obj/machinery/camera/motion/Initialize() ..() - upgradeMotion() + . = upgradeMotion() // ALL UPGRADES -/obj/machinery/camera/all/New() - ..() +/obj/machinery/camera/all/Initialize() + . = ..() upgradeEmpProof() upgradeXRay() upgradeMotion() @@ -103,12 +103,7 @@ /obj/machinery/camera/proc/upgradeMotion() assembly.upgrades.Add(new /obj/item/device/assembly/prox_sensor(assembly)) setPowerUsage() - if(!(src in GLOB.machines)) - if(!machinery_sort_required && ticker) - dd_insertObjectList(GLOB.machines, src) - else - GLOB.machines += src - machinery_sort_required = 1 + START_PROCESSING(SSmachines,src) update_coverage() /obj/machinery/camera/proc/setPowerUsage() diff --git a/code/game/machinery/computer/prisoner.dm b/code/game/machinery/computer/prisoner.dm index 562629df83ac3..afffc14eec0e5 100644 --- a/code/game/machinery/computer/prisoner.dm +++ b/code/game/machinery/computer/prisoner.dm @@ -60,13 +60,6 @@ onclose(user, "computer") return - - process() - if(!..()) - src.updateDialog() - return - - Topic(href, href_list) if(..()) return @@ -102,3 +95,8 @@ src.add_fingerprint(usr) src.updateUsrDialog() return + +/obj/machinery/computer/prisoner/Process() + if(!..()) + src.updateDialog() + return \ No newline at end of file diff --git a/code/game/machinery/door_control.dm b/code/game/machinery/door_control.dm index cff68590667cb..f9a7fe1a1b324 100644 --- a/code/game/machinery/door_control.dm +++ b/code/game/machinery/door_control.dm @@ -171,6 +171,7 @@ icon_state = "launcherbtt" /obj/machinery/button/remote/driver/trigger(mob/user as mob) + set waitfor = 0 active = 1 update_icon() diff --git a/code/game/machinery/machinery.dm b/code/game/machinery/machinery.dm index d993fc3355c85..c254f5d79a416 100644 --- a/code/game/machinery/machinery.dm +++ b/code/game/machinery/machinery.dm @@ -123,16 +123,15 @@ Class Procs: ..(l) if(d) set_dir(d) - if(!machinery_sort_required && ticker) - dd_insertObjectList(GLOB.machines, src) - else - GLOB.machines += src - machinery_sort_required = 1 GLOB.emp_candidates.Add(src) +/obj/machinery/Initialize() + . = ..() + START_PROCESSING(SSmachines, src) + /obj/machinery/Destroy() - GLOB.machines -= src + STOP_PROCESSING(SSmachines, src) GLOB.emp_candidates.Remove(src) if(component_parts) for(var/atom/A in component_parts) @@ -140,10 +139,7 @@ Class Procs: qdel(A) else // Otherwise we assume they were dropped to the ground during deconstruction, and were not removed from the component_parts list by deconstruction code. component_parts -= A - if(contents) // The same for contents. - for(var/atom/A in contents) - qdel(A) - return ..() + . = ..() /obj/machinery/process()//If you dont use process or power why are you here if(!(use_power || idle_power_usage || active_power_usage)) diff --git a/code/game/machinery/magnet.dm b/code/game/machinery/magnet.dm index 4a365bb85b971..19860c2102290 100644 --- a/code/game/machinery/magnet.dm +++ b/code/game/machinery/magnet.dm @@ -129,7 +129,7 @@ - process() + Process() if(stat & NOPOWER) on = 0 @@ -239,7 +239,7 @@ filter_path() // renders rpath - process() + Process() if(magnets.len == 0 && autolink) for(var/obj/machinery/magnetic_module/M in world) if(M.freq == frequency && M.code == code) diff --git a/code/game/machinery/nuclear_bomb.dm b/code/game/machinery/nuclear_bomb.dm index 584eb5bdfd098..3172eb6aba35d 100644 --- a/code/game/machinery/nuclear_bomb.dm +++ b/code/game/machinery/nuclear_bomb.dm @@ -54,9 +54,9 @@ var/global/orion_password = null auth = null return ..() -/obj/machinery/nuclearbomb/process() +/obj/machinery/nuclearbomb/Process() if (timing) - timeleft = max(timeleft - (process_schedule_interval("machinery") / 10), 0) + timeleft = max(timeleft - (wait / 10), 0) if (timeleft <= 0) spawn explode() diff --git a/code/game/machinery/syndicatebeacon.dm b/code/game/machinery/syndicatebeacon.dm index 8e2132ac02e11..aebe893e8f820 100644 --- a/code/game/machinery/syndicatebeacon.dm +++ b/code/game/machinery/syndicatebeacon.dm @@ -91,6 +91,10 @@ var/active = 0 var/icontype = "beacon" +/obj/machinery/power/singularity_beacon/Destroy() + if(active) + STOP_PROCESSING(SSmachines, src) + . = ..() /obj/machinery/power/singularity_beacon/proc/Activate(mob/user = null) if(surplus() < 1500) @@ -101,7 +105,7 @@ singulo.target = src icon_state = "[icontype]1" active = 1 - GLOB.machines |= src + START_PROCESSING(SSmachines, src) if(user) to_chat(user, "You activate the beacon.") diff --git a/code/game/objects/effects/chem/foam.dm b/code/game/objects/effects/chem/foam.dm index f9aadf2cab01f..88860695778cd 100644 --- a/code/game/objects/effects/chem/foam.dm +++ b/code/game/objects/effects/chem/foam.dm @@ -21,13 +21,13 @@ metal = ismetal playsound(src, 'sound/effects/bubbles2.ogg', 80, 1, -3) spawn(3 + metal * 3) - process() + Process() checkReagents() var/locktime = 120 if(metal == 2) locktime = 10 spawn(locktime) - GLOB.processing_objects.Remove(src) + STOP_PROCESSING(SSobj, src) sleep(30) if(metal) var/obj/structure/foamedmetal/M = new(src.loc) @@ -45,7 +45,7 @@ for(var/obj/O in T) reagents.touch_obj(O) -/obj/effect/effect/foam/process() +/obj/effect/effect/foam/Process() if(--amount < 0) return diff --git a/code/game/objects/effects/force_portal.dm b/code/game/objects/effects/force_portal.dm index 90e2fa24979a2..d35e739425eb2 100644 --- a/code/game/objects/effects/force_portal.dm +++ b/code/game/objects/effects/force_portal.dm @@ -9,8 +9,8 @@ anchored = 1 var/boom_time = 1 -/obj/effect/force_portal/New(var/loc) - ..() +/obj/effect/force_portal/Initialize(var/loc) + . = ..() boom_time = world.time + 30 SECONDS GLOB.processing_objects += src diff --git a/code/game/objects/effects/spiders.dm b/code/game/objects/effects/spiders.dm index 97ad08c09d249..202b67adbfdb9 100644 --- a/code/game/objects/effects/spiders.dm +++ b/code/game/objects/effects/spiders.dm @@ -126,7 +126,7 @@ var/shift_range = 6 -/obj/effect/spider/spiderling/New(var/location, var/atom/parent) +/obj/effect/spider/spiderling/Initialize(var/location, var/atom/parent) greater_form = pick(typesof(/mob/living/simple_animal/hostile/giant_spider)) icon_state = initial(greater_form.icon_state) pixel_x = rand(-shift_range, shift_range) @@ -142,7 +142,7 @@ GLOB.processing_objects |= src get_light_and_color(parent) - ..() + . = ..() /obj/effect/spider/spiderling/mundane growth_chance = 0 // Just a simple, non-mutant spider diff --git a/code/game/objects/items/devices/flashlight.dm b/code/game/objects/items/devices/flashlight.dm index 6435030f888e1..7feacc2dffde8 100644 --- a/code/game/objects/items/devices/flashlight.dm +++ b/code/game/objects/items/devices/flashlight.dm @@ -252,6 +252,10 @@ light_color = color ..() +/obj/item/device/flashlight/glowstick/Destroy() + . = ..() + STOP_PROCESSING(SSobj, src) + /obj/item/device/flashlight/glowstick/process() fuel = max(fuel - 1, 0) if(!fuel) diff --git a/code/game/objects/items/devices/geiger.dm b/code/game/objects/items/devices/geiger.dm index 4d81cd905f74c..459565bc4b251 100644 --- a/code/game/objects/items/devices/geiger.dm +++ b/code/game/objects/items/devices/geiger.dm @@ -13,8 +13,13 @@ var/scanning = 0 var/radiation_count = 0 -/obj/item/device/geiger/New() - GLOB.processing_objects |= src +/obj/item/device/geiger/Initialize() + . = ..() + START_PROCESSING(SSobj, src) + +/obj/item/device/geiger/Destroy() + . = ..() + STOP_PROCESSING(SSobj, src) /obj/item/device/geiger/process() if(!scanning) diff --git a/code/game/objects/items/devices/powersink.dm b/code/game/objects/items/devices/powersink.dm index 3281fd384f785..02ea4fad8e69d 100644 --- a/code/game/objects/items/devices/powersink.dm +++ b/code/game/objects/items/devices/powersink.dm @@ -26,8 +26,8 @@ var/obj/structure/cable/attached // the attached cable /obj/item/device/powersink/Destroy() - GLOB.processing_objects.Remove(src) - GLOB.processing_power_items.Remove(src) + if(mode == 2) + STOP_PROCESSING_POWER_OBJECT(src) . = ..() /obj/item/device/powersink/attackby(var/obj/item/I, var/mob/user) @@ -49,8 +49,7 @@ return else if (mode == 2) - GLOB.processing_objects.Remove(src) // Now the power sink actually stops draining the station's power if you unhook it. --NeoFite - GLOB.processing_power_items.Remove(src) + STOP_PROCESSING_POWER_OBJECT(src) anchored = 0 mode = 0 src.visible_message("[user] detaches [src] from the cable!") @@ -72,15 +71,13 @@ src.visible_message("[user] activates [src]!") mode = 2 icon_state = "powersink1" - GLOB.processing_objects.Add(src) - GLOB.processing_power_items.Add(src) + START_PROCESSING_POWER_OBJECT(src) if(2) //This switch option wasn't originally included. It exists now. --NeoFite src.visible_message("[user] deactivates [src]!") mode = 1 set_light(0) icon_state = "powersink0" - GLOB.processing_objects.Remove(src) - GLOB.processing_power_items.Remove(src) + STOP_PROCESSING_POWER_OBJECT(src) /obj/item/device/powersink/pwr_drain() if(!attached) @@ -117,7 +114,7 @@ return 1 -/obj/item/device/powersink/process() +/obj/item/device/powersink/Process() drained_this_tick = 0 power_drained -= min(dissipation_rate, power_drained) if(power_drained > max_power * 0.95) diff --git a/code/game/objects/items/devices/suit_cooling.dm b/code/game/objects/items/devices/suit_cooling.dm index 9ca9d5ab291f9..ca233a5b66f03 100644 --- a/code/game/objects/items/devices/suit_cooling.dm +++ b/code/game/objects/items/devices/suit_cooling.dm @@ -35,10 +35,14 @@ /obj/item/device/suit_cooling_unit/Initialize() . = ..() - GLOB.processing_objects |= src + START_PROCESSING(SSobj, src) cell = new/obj/item/weapon/cell/high() // 10K rated cell. cell.forceMove(src) +/obj/item/device/suit_cooling_unit/Destroy() + . = ..() + STOP_PROCESSING(SSobj, src) + /obj/item/device/suit_cooling_unit/process() if (!on || !cell) return diff --git a/code/game/objects/items/devices/suit_sensor_jammer.dm b/code/game/objects/items/devices/suit_sensor_jammer.dm index fd6038f6e39f5..8da2919e51652 100644 --- a/code/game/objects/items/devices/suit_sensor_jammer.dm +++ b/code/game/objects/items/devices/suit_sensor_jammer.dm @@ -1,5 +1,5 @@ #define JAMMER_MAX_RANGE world.view*2 -#define JAMMER_POWER_CONSUMPTION ((max(0.75, range)**2 * jammer_method.energy_cost * process_schedule_interval("obj")) / 20) +#define JAMMER_POWER_CONSUMPTION(tick_delay) ((max(0.75, range)**2 * jammer_method.energy_cost * tick_delay) / 20) /obj/item/device/suit_sensor_jammer name = "small device" @@ -135,7 +135,7 @@ obj/item/device/suit_sensor_jammer/ui_data() "methods" = methods, "current_method" = "\ref[jammer_method]", "current_cost" = jammer_method.energy_cost, - "total_cost" = "[ceil(JAMMER_POWER_CONSUMPTION)]" + "total_cost" = "[ceil(JAMMER_POWER_CONSUMPTION(10))]" ) return data @@ -162,11 +162,11 @@ obj/item/device/suit_sensor_jammer/ui_act(action, params) set_method(method) . = TRUE -/obj/item/device/suit_sensor_jammer/process() +/obj/item/device/suit_sensor_jammer/Process(var/wait) if(bcell) // With a range of 2 and jammer cost of 3 the default (high capacity) cell will last for almost 14 minutes, give or take // 10000 / (2^2 * 3 / 10) ~= 8333 ticks ~= 13.8 minutes - var/deduction = JAMMER_POWER_CONSUMPTION + var/deduction = JAMMER_POWER_CONSUMPTION(wait) if(!bcell.use(deduction)) disable() else diff --git a/code/game/objects/items/devices/t_scanner.dm b/code/game/objects/items/devices/t_scanner.dm index 4dcbeefc1b83c..c709cea3a07f2 100644 --- a/code/game/objects/items/devices/t_scanner.dm +++ b/code/game/objects/items/devices/t_scanner.dm @@ -21,6 +21,11 @@ var/global/list/overlay_cache = list() //cache recent overlays +/obj/item/device/t_scanner/Destroy() + . = ..() + if(on) + set_active(FALSE) + /obj/item/device/t_scanner/update_icon() icon_state = "t-ray[on]" diff --git a/code/game/objects/items/glassjar.dm b/code/game/objects/items/glassjar.dm index d021871d65fcf..e3009ba53c853 100644 --- a/code/game/objects/items/glassjar.dm +++ b/code/game/objects/items/glassjar.dm @@ -57,7 +57,7 @@ return if(3) for(var/obj/effect/spider/spiderling/S in src) - S.loc = user.loc + S.dropInto(user.loc) user.visible_message("[user] releases [S] from \the [src].", "You release [S] from \the [src].") GLOB.processing_objects.Add(S) // They can grow after being let out though contains = 0 diff --git a/code/game/objects/items/weapons/cigs_lighters.dm b/code/game/objects/items/weapons/cigs_lighters.dm index 2b952f5730c7e..ddf33f4091dc3 100644 --- a/code/game/objects/items/weapons/cigs_lighters.dm +++ b/code/game/objects/items/weapons/cigs_lighters.dm @@ -103,6 +103,11 @@ CIGARETTE PACKETS ARE IN FANCY.DM flags |= NOREACT // so it doesn't react until you light it create_reagents(chem_volume) // making the cigarrete a chemical holder with a maximum volume of 15 +/obj/item/clothing/mask/smokable/Destroy() + . = ..() + if(lit) + STOP_PROCESSING(SSobj, src) + /obj/item/clothing/mask/smokable/proc/smoke(amount) smoketime -= amount if(reagents && reagents.total_volume) // check if it has any reagents at all diff --git a/code/game/objects/items/weapons/material/ashtray.dm b/code/game/objects/items/weapons/material/ashtray.dm index fcd65bff7cf77..a8747ab78b70d 100644 --- a/code/game/objects/items/weapons/material/ashtray.dm +++ b/code/game/objects/items/weapons/material/ashtray.dm @@ -17,7 +17,6 @@ var/global/list/ashtray_cache = list() return max_butts = round(material.hardness/10) //This is arbitrary but whatever. update_icon() - return /obj/item/weapon/material/ashtray/update_icon() color = null @@ -56,7 +55,6 @@ var/global/list/ashtray_cache = list() var/obj/item/clothing/mask/smokable/cigarette/cig = W if (cig.lit == 1) src.visible_message("[user] crushes [cig] in \the [src], putting it out.") - GLOB.processing_objects.Remove(cig) var/obj/item/butt = new cig.type_butt(src) cig.transfer_fingerprints_to(butt) qdel(cig) diff --git a/code/game/objects/items/weapons/melee/energy.dm b/code/game/objects/items/weapons/melee/energy.dm index 26a8ed129b610..c44e53044727e 100644 --- a/code/game/objects/items/weapons/melee/energy.dm +++ b/code/game/objects/items/weapons/melee/energy.dm @@ -8,6 +8,7 @@ flags = NOBLOODY var/activate_sound = 'sound/weapons/saberon.ogg' var/deactivate_sound = 'sound/weapons/saberoff.ogg' + /obj/item/weapon/melee/energy/proc/activate(mob/living/user) anchored = 1 if(active) @@ -176,15 +177,19 @@ var/datum/effect/effect/system/spark_spread/spark_system /obj/item/weapon/melee/energy/blade/New() - + ..() spark_system = new /datum/effect/effect/system/spark_spread() spark_system.set_up(5, 0, src) spark_system.attach(src) GLOB.processing_objects |= src +/obj/item/weapon/melee/energy/blade/Initialize() + . = ..() + START_PROCESSING(SSobj, src) + /obj/item/weapon/melee/energy/blade/Destroy() - GLOB.processing_objects -= src + STOP_PROCESSING(SSobj, src) . = ..() /obj/item/weapon/melee/energy/blade/get_storage_cost() diff --git a/code/game/objects/items/weapons/weaponry.dm b/code/game/objects/items/weapons/weaponry.dm index a5b170b3ff364..ccb66f4fa4069 100644 --- a/code/game/objects/items/weapons/weaponry.dm +++ b/code/game/objects/items/weapons/weaponry.dm @@ -100,9 +100,9 @@ /obj/effect/energy_net/teleport countdown = 60 -/obj/effect/energy_net/New() - ..() - GLOB.processing_objects.Add(src) +/obj/effect/energy_net/Initialize() + . = ..() + START_PROCESSING(SSobj, src) /obj/effect/energy_net/Destroy() if(istype(captured, /mob/living/carbon)) @@ -110,11 +110,11 @@ captured.handcuffed = null if(captured) unbuckle_mob() - GLOB.processing_objects.Remove(src) + START_PROCESSING(SSobj, src) captured = null return ..() -/obj/effect/energy_net/process() +/obj/effect/energy_net/Process() countdown-- if(captured.buckled != src) health = 0 diff --git a/code/game/objects/objs.dm b/code/game/objects/objs.dm index bd9148a62d83f..e9730bcb71072 100644 --- a/code/game/objects/objs.dm +++ b/code/game/objects/objs.dm @@ -15,7 +15,7 @@ ai_access_level = 1 /obj/Destroy() - GLOB.processing_objects -= src + START_PROCESSING(SSobj, src) return ..() /obj/Topic(href, href_list, var/datum/topic_state/state = GLOB.default_state) @@ -70,10 +70,6 @@ /obj/item/proc/is_used_on(obj/O, mob/user) -/obj/proc/process() - GLOB.processing_objects.Remove(src) - return 0 - /obj/assume_air(datum/gas_mixture/giver) if(loc) return loc.assume_air(giver) diff --git a/code/game/objects/structures/alien/egg.dm b/code/game/objects/structures/alien/egg.dm index 025f8298b812f..1274478fd5336 100644 --- a/code/game/objects/structures/alien/egg.dm +++ b/code/game/objects/structures/alien/egg.dm @@ -8,12 +8,12 @@ anchored = 1 var/progress = 0 -/obj/structure/alien/egg/New() +/obj/structure/alien/egg/Initialize() ..() - GLOB.processing_objects += src + START_PROCESSING(SSobj, src) /obj/structure/alien/egg/Destroy() - GLOB.processing_objects -= src + STOP_PROCESSING(SSobj, src) . = ..() /obj/structure/alien/egg/CanUseTopic(var/mob/user) @@ -26,13 +26,13 @@ if(href_list["spawn"]) attack_ghost(usr) -/obj/structure/alien/egg/process() +/obj/structure/alien/egg/Process() progress++ if(progress >= MAX_PROGRESS) for(var/mob/observer/ghost/O in GLOB.ghost_mob_list) if(O.client && O.client.prefs && (MODE_XENOMORPH in O.client.prefs.be_special_role)) to_chat(O, "An alien is ready to hatch! ([ghost_follow_link(src, O)]) (spawn)") - GLOB.processing_objects -= src + STOP_PROCESSING(SSobj, src) update_icon() /obj/structure/alien/egg/update_icon() diff --git a/code/game/objects/structures/alien/node.dm b/code/game/objects/structures/alien/node.dm index 35948a24bf2ab..a68e6ff7cd398 100644 --- a/code/game/objects/structures/alien/node.dm +++ b/code/game/objects/structures/alien/node.dm @@ -5,15 +5,15 @@ health = 100 layer = ABOVE_OBJ_LAYER -/obj/structure/alien/node/New() +/obj/structure/alien/node/Initialize() ..() - GLOB.processing_objects += src + START_PROCESSING(SSobj, src) /obj/structure/alien/node/Destroy() - GLOB.processing_objects -= src + STOP_PROCESSING(SSobj, src) . = ..() -/obj/structure/alien/node/process() +/obj/structure/alien/node/Process() if(locate(/obj/effect/plant) in loc) return new/obj/effect/plant(get_turf(src), plant_controller.seeds["xenomorph"], start_matured = 1) \ No newline at end of file diff --git a/code/game/world.dm b/code/game/world.dm new file mode 100644 index 0000000000000..bbf228a8a6a01 --- /dev/null +++ b/code/game/world.dm @@ -0,0 +1,736 @@ +/var/server_name = "Halo Spacestation Evolved" + +/var/game_id = null +/hook/global_init/proc/generate_gameid() + if(game_id != null) + return + game_id = "" + + var/list/c = list("a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0") + var/l = c.len + + var/t = world.timeofday + for(var/_ = 1 to 4) + game_id = "[c[(t % l) + 1]][game_id]" + t = round(t / l) + game_id = "-[game_id]" + t = round(world.realtime / (10 * 60 * 60 * 24)) + for(var/_ = 1 to 3) + game_id = "[c[(t % l) + 1]][game_id]" + t = round(t / l) + return 1 + +// Find mobs matching a given string +// +// search_string: the string to search for, in params format; for example, "some_key;mob_name" +// restrict_type: A mob type to restrict the search to, or null to not restrict +// +// Partial matches will be found, but exact matches will be preferred by the search +// +// Returns: A possibly-empty list of the strongest matches +/proc/text_find_mobs(search_string, restrict_type = null) + var/list/search = params2list(search_string) + var/list/ckeysearch = list() + for(var/text in search) + ckeysearch += ckey(text) + + var/list/match = list() + + for(var/mob/M in GLOB.mob_list) + if(restrict_type && !istype(M, restrict_type)) + continue + var/strings = list(M.name, M.ckey) + if(M.mind) + strings += M.mind.assigned_role + strings += M.mind.special_role + if(ishuman(M)) + var/mob/living/carbon/human/H = M + if(H.species) + strings += H.species.name + for(var/text in strings) + if(ckey(text) in ckeysearch) + match[M] += 10 // an exact match is far better than a partial one + else + for(var/searchstr in search) + if(findtext(text, searchstr)) + match[M] += 1 + + var/maxstrength = 0 + for(var/mob/M in match) + maxstrength = max(match[M], maxstrength) + for(var/mob/M in match) + if(match[M] < maxstrength) + match -= M + + return match + +#define RECOMMENDED_VERSION 513 +#if DM_VERSION < RECOMMENDED_VERSION +#error Your BYOND is out of date! +#endif +/world/New() + //Log startup times + var/startedAt = world.timeofday + + //set window title + name = "[server_name] - [GLOB.using_map.full_name]" + + //logs + SetupLogs() + var/date_string = time2text(world.realtime, "YYYY/MM-Month/DD-Day") + href_logfile = file("data/logs/[date_string] hrefs.htm") + diary = file("data/logs/[date_string].log") + diary << "[log_end]\n[log_end]\nStarting up. (ID: [game_id]) [time2text(world.timeofday, "hh:mm.ss")][log_end]\n---------------------[log_end]" + changelog_hash = md5('html/changelog.html') //used for telling if the changelog has changed recently + + if(byond_version < RECOMMENDED_VERSION) + world.log << "Your server's byond version does not meet the recommended requirements for this server. Please update BYOND" + + config.post_load() + + if(config && config.server_name != null && config.server_suffix && world.port > 0) + // dumb and hardcoded but I don't care~ + config.server_name += " #[(world.port % 1000) / 100]" + + if(config && config.log_runtime) + var/runtime_log = file("data/logs/runtime/[date_string]_[time2text(world.timeofday, "hh:mm")]_[game_id].log") + runtime_log << "Game [game_id] starting up at [time2text(world.timeofday, "hh:mm.ss")]" + log = runtime_log + + callHook("startup") + //Emergency Fix + load_mods() + //end-emergency fix + + var/timeToStart = world.timeofday - startedAt + log_world("Startup took: [timeToStart] seconds") + + . = ..() + +#ifdef UNIT_TEST + log_unit_test("Unit Tests Enabled. This will destroy the world when testing is complete.") + load_unit_test_changes() +#endif + + // Set up roundstart seed list. + plant_controller = new() + + // This is kinda important. Set up details of what the hell things are made of. + populate_material_list() + + if(config.generate_map) + if(GLOB.using_map.perform_map_generation()) + GLOB.using_map.refresh_mining_turfs() + GLOB.using_map.build_exoplanets() + + // Create robolimbs for chargen. + populate_robolimb_list() + + processScheduler = new + master_controller = new /datum/controller/game_controller() + + processScheduler.deferSetupFor(/datum/controller/process/ticker) + processScheduler.setup() + Master.Initialize(10, FALSE) + +#ifdef UNIT_TEST + spawn(1) + initialize_unit_tests() +#endif + + spawn(3000) //so we aren't adding to the round-start lag + if(config.ToRban) + ToRban_autoupdate() + +#undef RECOMMENDED_VERSION + +var/world_topic_spam_protect_ip = "0.0.0.0" +var/world_topic_spam_protect_time = world.timeofday + +/world/Topic(T, addr, master, key) + diary << "TOPIC: \"[T]\", from:[addr], master:[master], key:[key][log_end]" + + if (T == "ping") + var/x = 1 + for (var/client/C) + x++ + return x + + else if(T == "players") + var/n = 0 + for(var/mob/M in GLOB.player_list) + if(M.client) + n++ + return n + + else if (copytext(T,1,7) == "status") + var/input[] = params2list(T) + var/list/s = list() + s["version"] = game_version + s["mode"] = PUBLIC_GAME_MODE + s["respawn"] = config.abandon_allowed + s["enter"] = config.enter_allowed + s["vote"] = config.allow_vote_mode + s["ai"] = config.allow_ai + s["host"] = host ? host : null + + // This is dumb, but spacestation13.com's banners break if player count isn't the 8th field of the reply, so... this has to go here. + s["players"] = 0 + s["stationtime"] = stationtime2text() + s["roundduration"] = roundduration2text() + s["map"] = GLOB.using_map.full_name + + if(input["status"] == "2") + var/list/players = list() + var/list/admins = list() + + for(var/client/C in GLOB.clients) + if(C.holder) + if(C.is_stealthed()) + continue + admins[C.key] = C.holder.rank + players += C.key + + s["players"] = players.len + s["playerlist"] = list2params(players) + s["admins"] = admins.len + s["adminlist"] = list2params(admins) + else + var/n = 0 + var/admins = 0 + + for(var/client/C in GLOB.clients) + if(C.holder) + if(C.is_stealthed()) + continue //so stealthmins aren't revealed by the hub + admins++ + s["player[n]"] = C.key + n++ + + s["players"] = n + s["admins"] = admins + + return list2params(s) + + else if(T == "revision") + var/list/L = list() + L["gameid"] = game_id + L["dm_version"] = DM_VERSION // DreamMaker version compiled in + L["dd_version"] = world.byond_version // DreamDaemon version running on + + if(revdata.revision) + L["revision"] = revdata.revision + L["branch"] = revdata.branch + L["date"] = revdata.date + else + L["revision"] = "unknown" + + return list2params(L) + + else if(copytext(T,1,5) == "laws") + var/input[] = params2list(T) + if(input["key"] != config.comms_password) + if(world_topic_spam_protect_ip == addr && abs(world_topic_spam_protect_time - world.time) < 50) + + spawn(50) + world_topic_spam_protect_time = world.time + return "Bad Key (Throttled)" + + world_topic_spam_protect_time = world.time + world_topic_spam_protect_ip = addr + + return "Bad Key" + + var/list/match = text_find_mobs(input["laws"], /mob/living/silicon) + + if(!match.len) + return "No matches" + else if(match.len == 1) + var/mob/living/silicon/S = match[1] + var/info = list() + info["name"] = S.name + info["key"] = S.key + + if(!S.laws) + info["laws"] = null + return list2params(info) + + var/list/lawset_parts = list( + "ion" = S.laws.ion_laws, + "inherent" = S.laws.inherent_laws, + "supplied" = S.laws.supplied_laws + ) + + for(var/law_type in lawset_parts) + var/laws = list() + for(var/datum/ai_law/L in lawset_parts[law_type]) + laws += L.law + info[law_type] = list2params(laws) + + info["zero"] = S.laws.zeroth_law ? S.laws.zeroth_law.law : null + + return list2params(info) + + else + var/list/ret = list() + for(var/mob/M in match) + ret[M.key] = M.name + return list2params(ret) + + else if(copytext(T,1,5) == "info") + var/input[] = params2list(T) + if(input["key"] != config.comms_password) + if(world_topic_spam_protect_ip == addr && abs(world_topic_spam_protect_time - world.time) < 50) + + spawn(50) + world_topic_spam_protect_time = world.time + return "Bad Key (Throttled)" + + world_topic_spam_protect_time = world.time + world_topic_spam_protect_ip = addr + + return "Bad Key" + + var/list/match = text_find_mobs(input["info"]) + + if(!match.len) + return "No matches" + else if(match.len == 1) + var/mob/M = match[1] + var/info = list() + info["key"] = M.key + info["name"] = M.name == M.real_name ? M.name : "[M.name] ([M.real_name])" + info["role"] = M.mind ? (M.mind.assigned_role ? M.mind.assigned_role : "No role") : "No mind" + var/turf/MT = get_turf(M) + info["loc"] = M.loc ? "[M.loc]" : "null" + info["turf"] = MT ? "[MT] @ [MT.x], [MT.y], [MT.z]" : "null" + info["area"] = MT ? "[MT.loc]" : "null" + info["antag"] = M.mind ? (M.mind.special_role ? M.mind.special_role : "Not antag") : "No mind" + info["hasbeenrev"] = M.mind ? M.mind.has_been_rev : "No mind" + info["stat"] = M.stat + info["type"] = M.type + if(isliving(M)) + var/mob/living/L = M + info["damage"] = list2params(list( + oxy = L.getOxyLoss(), + tox = L.getToxLoss(), + fire = L.getFireLoss(), + brute = L.getBruteLoss(), + clone = L.getCloneLoss(), + brain = L.getBrainLoss() + )) + if(ishuman(M)) + var/mob/living/carbon/human/H = M + info["species"] = H.species.name + else + info["species"] = "non-human" + else + info["damage"] = "non-living" + info["species"] = "non-human" + info["gender"] = M.gender + return list2params(info) + else + var/list/ret = list() + for(var/mob/M in match) + ret[M.key] = M.name + return list2params(ret) + + else if(copytext(T,1,9) == "adminmsg") + /* + We got an adminmsg from IRC bot lets split the input then validate the input. + expected output: + 1. adminmsg = ckey of person the message is to + 2. msg = contents of message, parems2list requires + 3. validatationkey = the key the bot has, it should match the gameservers commspassword in it's configuration. + 4. sender = the ircnick that send the message. + */ + + + var/input[] = params2list(T) + if(input["key"] != config.comms_password) + if(world_topic_spam_protect_ip == addr && abs(world_topic_spam_protect_time - world.time) < 50) + + spawn(50) + world_topic_spam_protect_time = world.time + return "Bad Key (Throttled)" + + world_topic_spam_protect_time = world.time + world_topic_spam_protect_ip = addr + + return "Bad Key" + + var/client/C + var/req_ckey = ckey(input["adminmsg"]) + + for(var/client/K in GLOB.clients) + if(K.ckey == req_ckey) + C = K + break + if(!C) + return "No client with that name on server" + + var/rank = input["rank"] + if(!rank) + rank = "Admin" + if(rank == "Unknown") + rank = "Staff" + + var/message = "[rank] PM from [input["sender"]]: [input["msg"]]" + var/amessage = "[rank] PM from [input["sender"]] to [key_name(C)] : [input["msg"]]" + + C.received_irc_pm = world.time + C.irc_admin = input["sender"] + + sound_to(C, 'sound/effects/adminhelp.ogg') + to_chat(C, message) + + for(var/client/A in GLOB.admins) + if(A != C) + to_chat(A, amessage) + return "Message Successful" + + else if(copytext(T,1,6) == "notes") + /* + We got a request for notes from the IRC Bot + expected output: + 1. notes = ckey of person the notes lookup is for + 2. validationkey = the key the bot has, it should match the gameservers commspassword in it's configuration. + */ + var/input[] = params2list(T) + if(input["key"] != config.comms_password) + if(world_topic_spam_protect_ip == addr && abs(world_topic_spam_protect_time - world.time) < 50) + + spawn(50) + world_topic_spam_protect_time = world.time + return "Bad Key (Throttled)" + + world_topic_spam_protect_time = world.time + world_topic_spam_protect_ip = addr + return "Bad Key" + + return show_player_info_irc(ckey(input["notes"])) + + else if(copytext(T,1,4) == "age") + var/input[] = params2list(T) + if(input["key"] != config.comms_password) + if(world_topic_spam_protect_ip == addr && abs(world_topic_spam_protect_time - world.time) < 50) + spawn(50) + world_topic_spam_protect_time = world.time + return "Bad Key (Throttled)" + + world_topic_spam_protect_time = world.time + world_topic_spam_protect_ip = addr + return "Bad Key" + + var/age = get_player_age(input["age"]) + if(isnum(age)) + if(age >= 0) + return "[age]" + else + return "Ckey not found" + else + return "Database connection failed or not set up" + + else if(copytext(T,1,14) == "placepermaban") + var/input[] = params2list(T) + if(!config.ban_comms_password) + return "Not enabled" + if(input["bankey"] != config.ban_comms_password) + if(world_topic_spam_protect_ip == addr && abs(world_topic_spam_protect_time - world.time) < 50) + spawn(50) + world_topic_spam_protect_time = world.time + return "Bad Key (Throttled)" + + world_topic_spam_protect_time = world.time + world_topic_spam_protect_ip = addr + return "Bad Key" + + var/target = ckey(input["target"]) + + var/client/C + for(var/client/K in GLOB.clients) + if(K.ckey == target) + C = K + break + if(!C) + return "No client with that name found on server" + if(!C.mob) + return "Client missing mob" + + if(!_DB_ban_record(input["id"], "0", "127.0.0.1", 1, C.mob, -1, input["reason"])) + return "Save failed" + ban_unban_log_save("[input["id"]] has permabanned [C.ckey]. - Reason: [input["reason"]] - This is a ban until appeal.") + notes_add(target,"[input["id"]] has permabanned [C.ckey]. - Reason: [input["reason"]] - This is a ban until appeal.",input["id"]) + qdel(C) + + else if(copytext(T,1,19) == "prometheus_metrics") + var/input[] = params2list(T) + if(input["key"] != config.comms_password) + if(world_topic_spam_protect_ip == addr && abs(world_topic_spam_protect_time - world.time) < 50) + spawn(50) + world_topic_spam_protect_time = world.time + return "Bad Key (Throttled)" + + world_topic_spam_protect_time = world.time + world_topic_spam_protect_ip = addr + return "Bad Key" + + if(!GLOB || !GLOB.prometheus_metrics) + return "Metrics not ready" + + return GLOB.prometheus_metrics.collect() + + +/world/Reboot(var/reason) + /*spawn(0) + sound_to(world, sound(pick('sound/AI/newroundsexy.ogg','sound/misc/apcdestroyed.ogg','sound/misc/bangindonk.ogg')))// random end sounds!! - LastyBatsy + + */ + + processScheduler.stop() + + if(config.server) //if you set a server location in config.txt, it sends you there instead of trying to reconnect to the same world address. -- NeoFite + for(var/client/C in GLOB.clients) + send_link(C, "byond://[config.server]") + + if(config.wait_for_sigusr1_reboot && reason != 3) + text2file("foo", "reboot_called") + to_world("World reboot waiting for external scripts. Please be patient.") + return + + ..(reason) + +/world/Del() + callHook("shutdown") + return ..() + +/hook/startup/proc/loadMode() + world.load_mode() + return 1 + +/world/proc/load_mode() + if(!fexists("data/mode.txt")) + return + + var/list/Lines = file2list("data/mode.txt") + if(Lines.len) + if(Lines[1]) + master_mode = Lines[1] + log_misc("Saved mode is '[master_mode]'") + +/world/proc/save_mode(var/the_mode) + var/F = file("data/mode.txt") + fdel(F) + F << the_mode + +/hook/startup/proc/loadMOTD() + world.load_motd() + return 1 + +/world/proc/load_motd() + join_motd = file2text("config/motd.txt") + + +/proc/load_configuration() + if(config) + qdel(config) + config = new /datum/configuration() + config.load("config/config.txt") + config.load("config/game_options.txt","game_options") + config.loadsql("config/dbconfig.txt") + config.load_event("config/custom_event.txt") + +/hook/startup/proc/loadMods() + world.load_mods() + world.load_mentors() // no need to write another hook. + return 1 + +/world/proc/load_mods() + if(config.admin_legacy_system) + var/text = file2text("config/moderators.txt") + if (!text) + error("Failed to load config/mods.txt") + else + var/list/lines = splittext(text, "\n") + for(var/line in lines) + if (!line) + continue + + if (copytext(line, 1, 2) == ";") + continue + + var/title = "Moderator" + var/rights = admin_ranks[title] + + var/ckey = copytext(line, 1, length(line)+1) + var/datum/admins/D = new /datum/admins(title, rights, ckey) + D.associate(GLOB.ckey_directory[ckey]) + +/world/proc/load_mentors() + if(config.admin_legacy_system) + var/text = file2text("config/mentors.txt") + if (!text) + error("Failed to load config/mentors.txt") + else + var/list/lines = splittext(text, "\n") + for(var/line in lines) + if (!line) + continue + if (copytext(line, 1, 2) == ";") + continue + + var/title = "Mentor" + var/rights = admin_ranks[title] + + var/ckey = copytext(line, 1, length(line)+1) + var/datum/admins/D = new /datum/admins(title, rights, ckey) + D.associate(GLOB.ckey_directory[ckey]) + +/world/proc/update_status() + var/s = "" + + if (config && config.server_name) + s += "[config.server_name] — " + + s += "[station_name()]"; + s += " (Forums|Discord)" + + var/list/features = list() + + if(ticker) + if(master_mode) + features += master_mode + else + features += "STARTING" + + if (!config.enter_allowed) + features += "closed" + + features += config.abandon_allowed ? "respawn" : "no respawn" + + if (config && config.allow_vote_mode) + features += "vote" + + if (config && config.allow_ai) + features += "AI allowed" + + /*var/n = 0 + for (var/mob/M in GLOB.player_list) + if (M.client) + n++ + + if (n > 1) + features += "~[n] players" + else if (n > 0) + features += "~[n] player"*/ + + if (config && config.hostedby) + features += "hosted by [config.hostedby]" + + if (features) + s += ": [jointext(features, ", ")]" + + /* does this help? I do not know */ + if (src.status != s) + src.status = s + +/world/proc/SetupLogs() + GLOB.log_directory = "data/logs/[time2text(world.realtime, "YYYY/MM/DD")]/round-" + if(game_id) + GLOB.log_directory += "[game_id]" + else + GLOB.log_directory += "[replacetext(time_stamp(), ":", ".")]" + + GLOB.world_runtime_log << "\n\nStarting up round ID [game_id]. [time_stamp()]\n---------------------" + +#define FAILED_DB_CONNECTION_CUTOFF 5 +var/failed_db_connections = 0 +var/failed_old_db_connections = 0 + +/hook/startup/proc/connectDB() + if(!config.do_sql_connection) + return 1 + if(!setup_database_connection()) + world.log << "Your server failed to establish a connection with the feedback database." + else + world.log << "Feedback database connection established." + return 1 + +proc/setup_database_connection() + + if(failed_db_connections > FAILED_DB_CONNECTION_CUTOFF) //If it failed to establish a connection more than 5 times in a row, don't bother attempting to conenct anymore. + return 0 + + if(!dbcon) + dbcon = new() + + var/user = sqlfdbklogin + var/pass = sqlfdbkpass + var/db = sqlfdbkdb + var/address = sqladdress + var/port = sqlport + + dbcon.Connect("dbi:mysql:[db]:[address]:[port]","[user]","[pass]") + . = dbcon.IsConnected() + if ( . ) + failed_db_connections = 0 //If this connection succeeded, reset the failed connections counter. + else + failed_db_connections++ //If it failed, increase the failed connections counter. + world.log << dbcon.ErrorMsg() + + return . + +//This proc ensures that the connection to the feedback database (global variable dbcon) is established +proc/establish_db_connection() + if(failed_db_connections > FAILED_DB_CONNECTION_CUTOFF) + return 0 + + if(!dbcon || !dbcon.IsConnected()) + return setup_database_connection() + else + return 1 + + +/hook/startup/proc/connectOldDB() + if(!setup_old_database_connection()) + world.log << "Your server failed to establish a connection with the SQL database." + else + world.log << "SQL database connection established." + return 1 + +//These two procs are for the old database, while it's being phased out. See the tgstation.sql file in the SQL folder for more information. +proc/setup_old_database_connection() + + if(failed_old_db_connections > FAILED_DB_CONNECTION_CUTOFF) //If it failed to establish a connection more than 5 times in a row, don't bother attempting to conenct anymore. + return 0 + + if(!dbcon_old) + dbcon_old = new() + + var/user = sqllogin + var/pass = sqlpass + var/db = sqldb + var/address = sqladdress + var/port = sqlport + + dbcon_old.Connect("dbi:mysql:[db]:[address]:[port]","[user]","[pass]") + . = dbcon_old.IsConnected() + if ( . ) + failed_old_db_connections = 0 //If this connection succeeded, reset the failed connections counter. + else + failed_old_db_connections++ //If it failed, increase the failed connections counter. + world.log << dbcon.ErrorMsg() + + return . + +//This proc ensures that the connection to the feedback database (global variable dbcon) is established +proc/establish_old_db_connection() + if(failed_old_db_connections > FAILED_DB_CONNECTION_CUTOFF) + return 0 + + if(!dbcon_old || !dbcon_old.IsConnected()) + return setup_old_database_connection() + else + return 1 + +#undef FAILED_DB_CONNECTION_CUTOFF diff --git a/code/modules/admin/verbs/debug.dm b/code/modules/admin/verbs/debug.dm index 64ec431aa313c..adeafdaabe314 100644 --- a/code/modules/admin/verbs/debug.dm +++ b/code/modules/admin/verbs/debug.dm @@ -227,7 +227,7 @@ /client/proc/cmd_debug_make_powernets() set category = "Debug" set name = "Make Powernets" - makepowernets() + SSmachines.makepowernets() log_admin("[key_name(src)] has remade the powernet. makepowernets() called.") message_admins("[key_name_admin(src)] has remade the powernets. makepowernets() called.", 0) feedback_add_details("admin_verb","MPWN") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! diff --git a/code/modules/admin/verbs/grief_fixers.dm b/code/modules/admin/verbs/grief_fixers.dm index 7418c3d9e85ed..10cc97149ba95 100644 --- a/code/modules/admin/verbs/grief_fixers.dm +++ b/code/modules/admin/verbs/grief_fixers.dm @@ -14,12 +14,13 @@ var/current_time = world.timeofday // Depower the supermatter, as it would quickly blow up once we remove all gases from the pipes. - for(var/obj/machinery/power/supermatter/S in GLOB.machines) + for(var/obj/machinery/power/supermatter/S in SSmachines.machinery) S.power = 0 to_chat(usr, "\[1/5\] - Supermatter depowered") // Remove all gases from all pipenets - for(var/datum/pipe_network/PN in pipe_networks) + for(var/net in SSmachines.pipenets) + var/datum/pipe_network/PN = net for(var/datum/gas_mixture/G in PN.gases) G.gas = list() G.update_values() diff --git a/code/modules/assembly/assembly.dm b/code/modules/assembly/assembly.dm index 0d47fc8f92b27..a72dca5432557 100644 --- a/code/modules/assembly/assembly.dm +++ b/code/modules/assembly/assembly.dm @@ -112,9 +112,8 @@ return -/obj/item/device/assembly/process() - GLOB.processing_objects.Remove(src) - return +/obj/item/device/assembly/Process() + return PROCESS_KILL /obj/item/device/assembly/examine(mob/user) diff --git a/code/modules/atmospherics/components/binary_devices/pipeturbine.dm b/code/modules/atmospherics/components/binary_devices/pipeturbine.dm index 3e54278b3f618..fc491592dd9a9 100644 --- a/code/modules/atmospherics/components/binary_devices/pipeturbine.dm +++ b/code/modules/atmospherics/components/binary_devices/pipeturbine.dm @@ -40,17 +40,17 @@ if(node1) node1.disconnect(src) - qdel(network1) + QDEL_NULL(network1) if(node2) node2.disconnect(src) - qdel(network2) + QDEL_NULL(network2) node1 = null node2 = null - ..() + . = ..() - process() + Process() ..() if(anchored && !(stat&BROKEN)) kin_energy *= 1 - kin_loss @@ -247,16 +247,6 @@ if (turbine.stat & (BROKEN) || !turbine.anchored || turn(turbine.dir,180) != dir) turbine = null - process() - updateConnection() - if(!turbine || !anchored || stat & (BROKEN)) - return - - var/power_generated = kin_to_el_ratio * turbine.kin_energy - turbine.kin_energy -= power_generated - add_avail(power_generated) - - attackby(obj/item/weapon/W as obj, mob/user as mob) if(istype(W, /obj/item/weapon/wrench)) anchored = !anchored @@ -285,3 +275,12 @@ return src.set_dir(turn(src.dir, 90)) + +/obj/machinery/power/turbinemotor/Process() + updateConnection() + if(!turbine || !anchored || stat & (BROKEN)) + return + + var/power_generated = kin_to_el_ratio * turbine.kin_energy + turbine.kin_energy -= power_generated + add_avail(power_generated) \ No newline at end of file diff --git a/code/modules/atmospherics/components/binary_devices/pump.dm b/code/modules/atmospherics/components/binary_devices/pump.dm index a4cfb8f4bcaf2..5ab4ff7b8b6cc 100644 --- a/code/modules/atmospherics/components/binary_devices/pump.dm +++ b/code/modules/atmospherics/components/binary_devices/pump.dm @@ -62,7 +62,7 @@ Thus, the two variables affect pump operation are set in New(): /obj/machinery/atmospherics/binary/pump/hide(var/i) update_underlays() -/obj/machinery/atmospherics/binary/pump/process() +/obj/machinery/atmospherics/binary/pump/Process() last_power_draw = 0 last_flow_rate = 0 @@ -190,24 +190,26 @@ Thus, the two variables affect pump operation are set in New(): return /obj/machinery/atmospherics/binary/pump/Topic(href,href_list) - if(..()) return 1 + if(..()) return if(href_list["power"]) use_power = !use_power + . = 1 switch(href_list["set_press"]) if ("min") target_pressure = 0 + . = 1 if ("max") target_pressure = max_pressure_setting + . = 1 if ("set") var/new_pressure = input(usr,"Enter new output pressure (0-[max_pressure_setting]kPa)","Pressure control",src.target_pressure) as num src.target_pressure = between(0, new_pressure, max_pressure_setting) + . = 1 - usr.set_machine(src) - src.add_fingerprint(usr) - - src.update_icon() + if(.) + src.update_icon() /obj/machinery/atmospherics/binary/pump/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob) if (!istype(W, /obj/item/weapon/wrench)) diff --git a/code/modules/atmospherics/components/omni_devices/filter.dm b/code/modules/atmospherics/components/omni_devices/filter.dm index 407d3470b0a50..4e2c6c655802a 100644 --- a/code/modules/atmospherics/components/omni_devices/filter.dm +++ b/code/modules/atmospherics/components/omni_devices/filter.dm @@ -29,7 +29,7 @@ input = null output = null gas_filters.Cut() - ..() + . = ..() /obj/machinery/atmospherics/omni/filter/sort_ports() for(var/datum/omni_port/P in ports) @@ -58,7 +58,7 @@ return 0 -/obj/machinery/atmospherics/omni/filter/process() +/obj/machinery/atmospherics/omni/filter/Process() if(!..()) return 0 diff --git a/code/modules/atmospherics/components/omni_devices/mixer.dm b/code/modules/atmospherics/components/omni_devices/mixer.dm index 2e5b570852257..a21ddb4c83901 100644 --- a/code/modules/atmospherics/components/omni_devices/mixer.dm +++ b/code/modules/atmospherics/components/omni_devices/mixer.dm @@ -53,7 +53,7 @@ /obj/machinery/atmospherics/omni/mixer/Destroy() inputs.Cut() output = null - ..() + . = ..() /obj/machinery/atmospherics/omni/mixer/sort_ports() for(var/datum/omni_port/P in ports) @@ -98,7 +98,7 @@ return 0 -/obj/machinery/atmospherics/omni/mixer/process() +/obj/machinery/atmospherics/omni/mixer/Process() if(!..()) return 0 diff --git a/code/modules/atmospherics/components/portables_connector.dm b/code/modules/atmospherics/components/portables_connector.dm index 870c1e86024a5..10aaa58c174c7 100644 --- a/code/modules/atmospherics/components/portables_connector.dm +++ b/code/modules/atmospherics/components/portables_connector.dm @@ -37,7 +37,7 @@ /obj/machinery/atmospherics/portables_connector/hide(var/i) update_underlays() -/obj/machinery/atmospherics/portables_connector/process() +/obj/machinery/atmospherics/portables_connector/Process() ..() if(!on) return diff --git a/code/modules/atmospherics/components/shutoff.dm b/code/modules/atmospherics/components/shutoff.dm index b7d17a9eb22da..5cf78d6c05235 100644 --- a/code/modules/atmospherics/components/shutoff.dm +++ b/code/modules/atmospherics/components/shutoff.dm @@ -17,15 +17,10 @@ icon_state = "vclamp[open]" /obj/machinery/atmospherics/valve/shutoff/New() - GLOB.processing_objects |= src open() hide(1) ..() -/obj/machinery/atmospherics/valve/shutoff/Destroy() - GLOB.processing_objects -= src - . = ..() - /obj/machinery/atmospherics/valve/shutoff/attack_hand(mob/user as mob) ..() override_counter = 3 @@ -40,7 +35,7 @@ else reset_plane_and_layer() -/obj/machinery/atmospherics/valve/shutoff/process() +/obj/machinery/atmospherics/valve/shutoff/Process() ..() if(!node1 || !node2) @@ -67,5 +62,3 @@ node2_last_pressure = node2_pressure if(override_counter) override_counter-- - - return \ No newline at end of file diff --git a/code/modules/atmospherics/components/unary/heat_exchanger.dm b/code/modules/atmospherics/components/unary/heat_exchanger.dm index ef12378866372..66709b730797c 100644 --- a/code/modules/atmospherics/components/unary/heat_exchanger.dm +++ b/code/modules/atmospherics/components/unary/heat_exchanger.dm @@ -31,7 +31,7 @@ ..() - process() + Process() ..() if(!partner) return 0 diff --git a/code/modules/atmospherics/components/unary/oxygen_generator.dm b/code/modules/atmospherics/components/unary/oxygen_generator.dm index 59d147a25c329..4f78fd22aba3e 100644 --- a/code/modules/atmospherics/components/unary/oxygen_generator.dm +++ b/code/modules/atmospherics/components/unary/oxygen_generator.dm @@ -28,7 +28,7 @@ obj/machinery/atmospherics/unary/oxygen_generator air_contents.volume = 50 - process() + Process() ..() if(!on) return 0 diff --git a/code/modules/atmospherics/components/unary/vent_pump.dm b/code/modules/atmospherics/components/unary/vent_pump.dm index 6fec58226c0ce..80ccd750e1044 100644 --- a/code/modules/atmospherics/components/unary/vent_pump.dm +++ b/code/modules/atmospherics/components/unary/vent_pump.dm @@ -78,6 +78,9 @@ /obj/machinery/atmospherics/unary/vent_pump/Destroy() unregister_radio(src, frequency) + if(initial_loc) + initial_loc.air_vent_info -= id_tag + initial_loc.air_vent_names -= id_tag . = ..() /obj/machinery/atmospherics/unary/vent_pump/high_volume @@ -154,7 +157,7 @@ return 0 return 1 -/obj/machinery/atmospherics/unary/vent_pump/process() +/obj/machinery/atmospherics/unary/vent_pump/Process() ..() if (hibernate > world.time) @@ -429,13 +432,6 @@ new /obj/item/pipe(loc, make_from=src) qdel(src) -/obj/machinery/atmospherics/unary/vent_pump/Destroy() - if(initial_loc) - initial_loc.air_vent_info -= id_tag - initial_loc.air_vent_names -= id_tag - ..() - return - #undef DEFAULT_PRESSURE_DELTA #undef EXTERNAL_PRESSURE_BOUND diff --git a/code/modules/atmospherics/components/valve.dm b/code/modules/atmospherics/components/valve.dm index 705ced43f060f..39383233c4243 100644 --- a/code/modules/atmospherics/components/valve.dm +++ b/code/modules/atmospherics/components/valve.dm @@ -84,7 +84,7 @@ node1 = null node2 = null - ..() + . = ..() /obj/machinery/atmospherics/valve/proc/open() if(open) return 0 @@ -137,11 +137,10 @@ else src.open() -/obj/machinery/atmospherics/valve/process() +/obj/machinery/atmospherics/valve/Process() ..() - . = PROCESS_KILL - return + return PROCESS_KILL /obj/machinery/atmospherics/valve/atmos_init() ..() diff --git a/code/modules/atmospherics/datum_pipe_network.dm b/code/modules/atmospherics/datum_pipe_network.dm index 4884db5b51fbc..7e03f171b89cd 100644 --- a/code/modules/atmospherics/datum_pipe_network.dm +++ b/code/modules/atmospherics/datum_pipe_network.dm @@ -1,6 +1,5 @@ -var/global/list/datum/pipe_network/pipe_networks = list() -datum/pipe_network +/datum/pipe_network var/list/datum/gas_mixture/gases = list() //All of the gas_mixtures continuously connected in this network var/volume = 0 //caches the total volume for atmos machines to use in gas calculations @@ -11,77 +10,73 @@ datum/pipe_network var/update = 1 //var/datum/gas_mixture/air_transient = null - New() - //air_transient = new() +/datum/pipe_network/Destroy() + STOP_PROCESSING_PIPENET(src) + for(var/datum/pipeline/line_member in line_members) + line_member.network = null + for(var/obj/machinery/atmospherics/normal_member in normal_members) + normal_member.reassign_network(src, null) + gases.Cut() // Do not qdel the gases, we don't own them + return ..() - ..() +/datum/pipe_network/Process() + //Equalize gases amongst pipe if called for + if(update) + update = 0 + reconcile_air() //equalize_gases(gases) - Destroy() - pipe_networks -= src - for(var/datum/pipeline/line_member in line_members) - line_member.network = null - for(var/obj/machinery/atmospherics/normal_member in normal_members) - normal_member.reassign_network(src, null) - gases.Cut() // Do not qdel the gases, we don't own them - return ..() + //Give pipelines their process call for pressure checking and what not. Have to remove pressure checks for the time being as pipes dont radiate heat - Mport + //for(var/datum/pipeline/line_member in line_members) + // line_member.process() - proc/process() - //Equalize gases amongst pipe if called for - if(update) - update = 0 - reconcile_air() //equalize_gases(gases) +/datum/pipe_network/proc/build_network(obj/machinery/atmospherics/start_normal, obj/machinery/atmospherics/reference) + //Purpose: Generate membership roster + //Notes: Assuming that members will add themselves to appropriate roster in network_expand() - //Give pipelines their process call for pressure checking and what not. Have to remove pressure checks for the time being as pipes dont radiate heat - Mport - //for(var/datum/pipeline/line_member in line_members) - // line_member.process() + if(!start_normal) + qdel(src) + return - proc/build_network(obj/machinery/atmospherics/start_normal, obj/machinery/atmospherics/reference) - //Purpose: Generate membership roster - //Notes: Assuming that members will add themselves to appropriate roster in network_expand() + start_normal.network_expand(src, reference) - if(!start_normal) - qdel(src) + update_network_gases() - start_normal.network_expand(src, reference) + if((normal_members.len>0)||(line_members.len>0)) + START_PROCESSING_PIPENET(src) + else + qdel(src) - update_network_gases() +/datum/pipe_network/proc/merge(datum/pipe_network/giver) + if(giver==src) return 0 - if((normal_members.len>0)||(line_members.len>0)) - pipe_networks += src - else - qdel(src) + normal_members |= giver.normal_members - proc/merge(datum/pipe_network/giver) - if(giver==src) return 0 + line_members |= giver.line_members - normal_members |= giver.normal_members + for(var/obj/machinery/atmospherics/normal_member in giver.normal_members) + normal_member.reassign_network(giver, src) - line_members |= giver.line_members + for(var/datum/pipeline/line_member in giver.line_members) + line_member.network = src - for(var/obj/machinery/atmospherics/normal_member in giver.normal_members) - normal_member.reassign_network(giver, src) + update_network_gases() + return 1 - for(var/datum/pipeline/line_member in giver.line_members) - line_member.network = src +/datum/pipe_network/proc/update_network_gases() + //Go through membership roster and make sure gases is up to date - update_network_gases() - return 1 + gases = list() + volume = 0 - proc/update_network_gases() - //Go through membership roster and make sure gases is up to date + for(var/obj/machinery/atmospherics/normal_member in normal_members) + var/result = normal_member.return_network_air(src) + if(result) gases += result - gases = list() - volume = 0 + for(var/datum/pipeline/line_member in line_members) + gases += line_member.air - for(var/obj/machinery/atmospherics/normal_member in normal_members) - var/result = normal_member.return_network_air(src) - if(result) gases += result + for(var/datum/gas_mixture/air in gases) + volume += air.volume - for(var/datum/pipeline/line_member in line_members) - gases += line_member.air - - for(var/datum/gas_mixture/air in gases) - volume += air.volume - - proc/reconcile_air() - equalize_gases(gases) +/datum/pipe_network/proc/reconcile_air() + equalize_gases(gases) diff --git a/code/modules/atmospherics/datum_pipeline.dm b/code/modules/atmospherics/datum_pipeline.dm index f2f817fc181d6..282866eb6c38e 100644 --- a/code/modules/atmospherics/datum_pipeline.dm +++ b/code/modules/atmospherics/datum_pipeline.dm @@ -1,5 +1,5 @@ -datum/pipeline +/datum/pipeline var/datum/gas_mixture/air var/list/obj/machinery/atmospherics/pipe/members @@ -24,211 +24,211 @@ datum/pipeline . = ..() - proc/process()//This use to be called called from the pipe networks - - //Check to see if pressure is within acceptable limits - var/pressure = air.return_pressure() - if(pressure > alert_pressure) - for(var/obj/machinery/atmospherics/pipe/member in members) - if(!member.check_pressure(pressure)) - members.Remove(member) - break //Only delete 1 pipe per process - - proc/temporarily_store_air() - //Update individual gas_mixtures by volume ratio +/datum/pipeline/Process()//This use to be called called from the pipe networks + //Check to see if pressure is within acceptable limits + var/pressure = air.return_pressure() + if(pressure > alert_pressure) for(var/obj/machinery/atmospherics/pipe/member in members) - member.air_temporary = new - member.air_temporary.copy_from(air) - member.air_temporary.volume = member.volume - member.air_temporary.multiply(member.volume / air.volume) - - proc/build_pipeline(obj/machinery/atmospherics/pipe/base) + if(!member.check_pressure(pressure)) + members.Remove(member) + break //Only delete 1 pipe per process + +/datum/pipeline/proc/temporarily_store_air() + //Update individual gas_mixtures by volume ratio + + for(var/obj/machinery/atmospherics/pipe/member in members) + member.air_temporary = new + member.air_temporary.copy_from(air) + member.air_temporary.volume = member.volume + member.air_temporary.multiply(member.volume / air.volume) + +/datum/pipeline/proc/build_pipeline(obj/machinery/atmospherics/pipe/base) + air = new + + var/list/possible_expansions = list(base) + members = list(base) + edges = list() + + var/volume = base.volume + base.parent = src + alert_pressure = base.alert_pressure + + if(base.air_temporary) + air = base.air_temporary + base.air_temporary = null + else air = new - var/list/possible_expansions = list(base) - members = list(base) - edges = list() - - var/volume = base.volume - base.parent = src - alert_pressure = base.alert_pressure - - if(base.air_temporary) - air = base.air_temporary - base.air_temporary = null - else - air = new + while(possible_expansions.len>0) + for(var/obj/machinery/atmospherics/pipe/borderline in possible_expansions) - while(possible_expansions.len>0) - for(var/obj/machinery/atmospherics/pipe/borderline in possible_expansions) + var/list/result = borderline.pipeline_expansion() + var/edge_check = result.len - var/list/result = borderline.pipeline_expansion() - var/edge_check = result.len + if(result.len>0) + for(var/obj/machinery/atmospherics/pipe/item in result) + if(item.in_stasis) + continue + if(!members.Find(item)) + members += item + possible_expansions += item - if(result.len>0) - for(var/obj/machinery/atmospherics/pipe/item in result) - if(item.in_stasis) - continue - if(!members.Find(item)) - members += item - possible_expansions += item + volume += item.volume + item.parent = src - volume += item.volume - item.parent = src + alert_pressure = min(alert_pressure, item.alert_pressure) - alert_pressure = min(alert_pressure, item.alert_pressure) + if(item.air_temporary) + air.merge(item.air_temporary) - if(item.air_temporary) - air.merge(item.air_temporary) + edge_check-- - edge_check-- + if(edge_check>0) + edges += borderline - if(edge_check>0) - edges += borderline + possible_expansions -= borderline - possible_expansions -= borderline + air.volume = volume - air.volume = volume +/datum/pipeline/proc/network_expand(datum/pipe_network/new_network, obj/machinery/atmospherics/pipe/reference) - proc/network_expand(datum/pipe_network/new_network, obj/machinery/atmospherics/pipe/reference) + if(new_network.line_members.Find(src)) + return 0 - if(new_network.line_members.Find(src)) - return 0 + new_network.line_members += src - new_network.line_members += src + network = new_network - network = new_network + for(var/obj/machinery/atmospherics/pipe/edge in edges) + for(var/obj/machinery/atmospherics/result in edge.pipeline_expansion()) + if(!istype(result,/obj/machinery/atmospherics/pipe) && (result!=reference)) + result.network_expand(new_network, edge) - for(var/obj/machinery/atmospherics/pipe/edge in edges) - for(var/obj/machinery/atmospherics/result in edge.pipeline_expansion()) - if(!istype(result,/obj/machinery/atmospherics/pipe) && (result!=reference)) - result.network_expand(new_network, edge) + return 1 - return 1 +/datum/pipeline/proc/return_network(obj/machinery/atmospherics/reference) + if(!network) + network = new /datum/pipe_network() + network.build_network(src, null) + //technically passing these parameters should not be allowed + //however pipe_network.build_network(..) and pipeline.network_extend(...) + // were setup to properly handle this case - proc/return_network(obj/machinery/atmospherics/reference) - if(!network) - network = new /datum/pipe_network() - network.build_network(src, null) - //technically passing these parameters should not be allowed - //however pipe_network.build_network(..) and pipeline.network_extend(...) - // were setup to properly handle this case + return network - return network +/datum/pipeline/proc/mingle_with_turf(turf/simulated/target, mingle_volume) + var/datum/gas_mixture/air_sample = air.remove_ratio(mingle_volume/air.volume) + air_sample.volume = mingle_volume - proc/mingle_with_turf(turf/simulated/target, mingle_volume) - var/datum/gas_mixture/air_sample = air.remove_ratio(mingle_volume/air.volume) - air_sample.volume = mingle_volume + if(istype(target) && target.zone) + //Have to consider preservation of group statuses + var/datum/gas_mixture/turf_copy = new - if(istype(target) && target.zone) - //Have to consider preservation of group statuses - var/datum/gas_mixture/turf_copy = new + turf_copy.copy_from(target.zone.air) + turf_copy.volume = target.zone.air.volume //Copy a good representation of the turf from parent group - turf_copy.copy_from(target.zone.air) - turf_copy.volume = target.zone.air.volume //Copy a good representation of the turf from parent group + equalize_gases(list(air_sample, turf_copy)) + air.merge(air_sample) - equalize_gases(list(air_sample, turf_copy)) - air.merge(air_sample) + turf_copy.subtract(target.zone.air) - turf_copy.subtract(target.zone.air) + target.zone.air.merge(turf_copy) - target.zone.air.merge(turf_copy) + else + var/datum/gas_mixture/turf_air = target.return_air() - else - var/datum/gas_mixture/turf_air = target.return_air() + equalize_gases(list(air_sample, turf_air)) + air.merge(air_sample) + //turf_air already modified by equalize_gases() - equalize_gases(list(air_sample, turf_air)) - air.merge(air_sample) - //turf_air already modified by equalize_gases() + if(network) + network.update = 1 - if(network) - network.update = 1 +/datum/pipeline/proc/temperature_interact(turf/target, share_volume, thermal_conductivity) + var/total_heat_capacity = air.heat_capacity() + var/partial_heat_capacity = total_heat_capacity*(share_volume/air.volume) - proc/temperature_interact(turf/target, share_volume, thermal_conductivity) - var/total_heat_capacity = air.heat_capacity() - var/partial_heat_capacity = total_heat_capacity*(share_volume/air.volume) + if(istype(target, /turf/simulated)) + var/turf/simulated/modeled_location = target - if(istype(target, /turf/simulated)) - var/turf/simulated/modeled_location = target + if(modeled_location.blocks_air) - if(modeled_location.blocks_air) + if((modeled_location.heat_capacity>0) && (partial_heat_capacity>0)) + var/delta_temperature = air.temperature - modeled_location.temperature - if((modeled_location.heat_capacity>0) && (partial_heat_capacity>0)) - var/delta_temperature = air.temperature - modeled_location.temperature + var/heat = thermal_conductivity*delta_temperature* \ + (partial_heat_capacity*modeled_location.heat_capacity/(partial_heat_capacity+modeled_location.heat_capacity)) - var/heat = thermal_conductivity*delta_temperature* \ - (partial_heat_capacity*modeled_location.heat_capacity/(partial_heat_capacity+modeled_location.heat_capacity)) + air.temperature -= heat/total_heat_capacity + modeled_location.temperature += heat/modeled_location.heat_capacity - air.temperature -= heat/total_heat_capacity - modeled_location.temperature += heat/modeled_location.heat_capacity + else + var/delta_temperature = 0 + var/sharer_heat_capacity = 0 + if(modeled_location.zone) + delta_temperature = (air.temperature - modeled_location.zone.air.temperature) + sharer_heat_capacity = modeled_location.zone.air.heat_capacity() else - var/delta_temperature = 0 - var/sharer_heat_capacity = 0 + delta_temperature = (air.temperature - modeled_location.air.temperature) + sharer_heat_capacity = modeled_location.air.heat_capacity() - if(modeled_location.zone) - delta_temperature = (air.temperature - modeled_location.zone.air.temperature) - sharer_heat_capacity = modeled_location.zone.air.heat_capacity() - else - delta_temperature = (air.temperature - modeled_location.air.temperature) - sharer_heat_capacity = modeled_location.air.heat_capacity() + var/self_temperature_delta = 0 + var/sharer_temperature_delta = 0 - var/self_temperature_delta = 0 - var/sharer_temperature_delta = 0 + if((sharer_heat_capacity>0) && (partial_heat_capacity>0)) + var/heat = thermal_conductivity*delta_temperature* \ + (partial_heat_capacity*sharer_heat_capacity/(partial_heat_capacity+sharer_heat_capacity)) - if((sharer_heat_capacity>0) && (partial_heat_capacity>0)) - var/heat = thermal_conductivity*delta_temperature* \ - (partial_heat_capacity*sharer_heat_capacity/(partial_heat_capacity+sharer_heat_capacity)) + self_temperature_delta = -heat/total_heat_capacity + sharer_temperature_delta = heat/sharer_heat_capacity + else + return 1 - self_temperature_delta = -heat/total_heat_capacity - sharer_temperature_delta = heat/sharer_heat_capacity - else - return 1 + air.temperature += self_temperature_delta - air.temperature += self_temperature_delta + if(modeled_location.zone) + modeled_location.zone.air.temperature += sharer_temperature_delta/modeled_location.zone.air.group_multiplier + else + modeled_location.air.temperature += sharer_temperature_delta - if(modeled_location.zone) - modeled_location.zone.air.temperature += sharer_temperature_delta/modeled_location.zone.air.group_multiplier - else - modeled_location.air.temperature += sharer_temperature_delta + else + if((target.heat_capacity>0) && (partial_heat_capacity>0)) + var/delta_temperature = air.temperature - target.temperature - else - if((target.heat_capacity>0) && (partial_heat_capacity>0)) - var/delta_temperature = air.temperature - target.temperature + var/heat = thermal_conductivity*delta_temperature* \ + (partial_heat_capacity*target.heat_capacity/(partial_heat_capacity+target.heat_capacity)) - var/heat = thermal_conductivity*delta_temperature* \ - (partial_heat_capacity*target.heat_capacity/(partial_heat_capacity+target.heat_capacity)) - - air.temperature -= heat/total_heat_capacity + air.temperature -= heat/total_heat_capacity if(network) - network.update = 1 + network.update = 1 //surface must be the surface area in m^2 - proc/radiate_heat_to_space(surface, thermal_conductivity) - var/gas_density = air.total_moles/air.volume - thermal_conductivity *= min(gas_density / ( RADIATOR_OPTIMUM_PRESSURE/(R_IDEAL_GAS_EQUATION*GAS_CRITICAL_TEMPERATURE) ), 1) //mult by density ratio +/datum/pipeline/proc/radiate_heat_to_space(surface, thermal_conductivity) + var/gas_density = air.total_moles/air.volume + thermal_conductivity *= min(gas_density / ( RADIATOR_OPTIMUM_PRESSURE/(R_IDEAL_GAS_EQUATION*GAS_CRITICAL_TEMPERATURE) ), 1) //mult by density ratio - var/heat_gain = get_thermal_radiation(air.temperature, surface, RADIATOR_EXPOSED_SURFACE_AREA_RATIO, thermal_conductivity) + var/heat_gain = get_thermal_radiation(air.temperature, surface, RADIATOR_EXPOSED_SURFACE_AREA_RATIO, thermal_conductivity) - air.add_thermal_energy(heat_gain) - if(network) - network.update = 1 + air.add_thermal_energy(heat_gain) + if(network) + network.update = 1 //Returns the amount of heat gained while in space due to thermal radiation (usually a negative value) //surface - the surface area in m^2 //exposed_surface_ratio - the proportion of the surface that is exposed to sunlight //thermal_conductivity - a multipler on the heat transfer rate. See OPEN_HEAT_TRANSFER_COEFFICIENT and friends /proc/get_thermal_radiation(var/surface_temperature, var/surface, var/exposed_surface_ratio, var/thermal_conductivity) - //*** Gain heat from sunlight, then lose heat from radiation. + //*** Gain heat from sunlight, then lose heat from radiation. - // We only get heat from the star on the exposed surface area. - // If the HE pipes gain more energy from AVERAGE_SOLAR_RADIATION than they can radiate, then they have a net heat increase. - . = AVERAGE_SOLAR_RADIATION * (exposed_surface_ratio * surface) * thermal_conductivity + // We only get heat from the star on the exposed surface area. + // If the HE pipes gain more energy from AVERAGE_SOLAR_RADIATION than they can radiate, then they have a net heat increase. + . = AVERAGE_SOLAR_RADIATION * (exposed_surface_ratio * surface) * thermal_conductivity - // Previously, the temperature would enter equilibrium at 26C or 294K. - // Only would happen if both sides (all 2 square meters of surface area) were exposed to sunlight. We now assume it aligned edge on. - // It currently should stabilise at 129.6K or -143.6C - . -= surface * STEFAN_BOLTZMANN_CONSTANT * thermal_conductivity * (surface_temperature - COSMIC_RADIATION_TEMPERATURE) ** 4 \ No newline at end of file + // Previously, the temperature would enter equilibrium at 26C or 294K. + // Only would happen if both sides (all 2 square meters of surface area) were exposed to sunlight. We now assume it aligned edge on. + // It currently should stabilise at 129.6K or -143.6C + . -= surface * STEFAN_BOLTZMANN_CONSTANT * thermal_conductivity * (surface_temperature - COSMIC_RADIATION_TEMPERATURE) ** 4 \ No newline at end of file diff --git a/code/modules/atmospherics/he_pipes.dm b/code/modules/atmospherics/he_pipes.dm index 6c389945a5b26..11925388c3947 100644 --- a/code/modules/atmospherics/he_pipes.dm +++ b/code/modules/atmospherics/he_pipes.dm @@ -55,7 +55,7 @@ obj/machinery/atmospherics/pipe/simple/heat_exchanging update_icon() - process() + Process() if(!parent) ..() else diff --git a/code/modules/mining/mint.dm b/code/modules/mining/mint.dm index 51a65efff5f31..7ecf03901cef6 100644 --- a/code/modules/mining/mint.dm +++ b/code/modules/mining/mint.dm @@ -21,21 +21,17 @@ var/coinsToProduce = 10 -/obj/machinery/mineral/mint/New() - ..() - spawn( 5 ) - for (var/dir in GLOB.cardinal) - src.input = locate(/obj/machinery/mineral/input, get_step(src, dir)) - if(src.input) break - for (var/dir in GLOB.cardinal) - src.output = locate(/obj/machinery/mineral/output, get_step(src, dir)) - if(src.output) break - GLOB.processing_objects.Add(src) - return - return +/obj/machinery/mineral/mint/Initialize() + . = ..() + for (var/dir in GLOB.cardinal) + src.input = locate(/obj/machinery/mineral/input, get_step(src, dir)) + if(src.input) break + for (var/dir in GLOB.cardinal) + src.output = locate(/obj/machinery/mineral/output, get_step(src, dir)) + if(src.output) break -/obj/machinery/mineral/mint/process() +/obj/machinery/mineral/mint/Process() if ( src.input) var/obj/item/stack/O O = locate(/obj/item/stack, input.loc) diff --git a/code/modules/mob/living/carbon/human/human_species.dm b/code/modules/mob/living/carbon/human/human_species.dm index da724847f0a12..dfa97e6f421cf 100644 --- a/code/modules/mob/living/carbon/human/human_species.dm +++ b/code/modules/mob/living/carbon/human/human_species.dm @@ -1,10 +1,11 @@ /mob/living/carbon/human/dummy real_name = "Test Dummy" status_flags = GODMODE|CANPUSH + virtual_mob = null -/mob/living/carbon/human/dummy/mannequin/New() - ..() - GLOB.mob_list -= src +/mob/living/carbon/human/dummy/mannequin/Initialize() + . = ..() + STOP_PROCESSING(SSmobs, src) GLOB.human_mob_list -= src delete_inventory() diff --git a/code/modules/mob/living/carbon/xenobiological/items.dm b/code/modules/mob/living/carbon/xenobiological/items.dm index 9f44341bb3842..70a5b8074357e 100644 --- a/code/modules/mob/living/carbon/xenobiological/items.dm +++ b/code/modules/mob/living/carbon/xenobiological/items.dm @@ -241,11 +241,11 @@ plane = ABOVE_TURF_PLANE layer = RUNE_LAYER -/obj/effect/golemrune/New() +/obj/effect/golemrune/Initialize() ..() - GLOB.processing_objects.Add(src) + START_PROCESSING(SSobj, src) -/obj/effect/golemrune/process() +/obj/effect/golemrune/Process() var/mob/observer/ghost/ghost for(var/mob/observer/ghost/O in src.loc) if(!O.client) continue diff --git a/code/modules/mob/living/life.dm b/code/modules/mob/living/life.dm index a09681e2d1d38..abf77502da829 100644 --- a/code/modules/mob/living/life.dm +++ b/code/modules/mob/living/life.dm @@ -54,7 +54,7 @@ update_pulling() for(var/obj/item/grab/G in src) - G.process() + G.Process() blinded = 0 // Placing this here just show how out of place it is. // human/handle_regular_status_updates() needs a cleanup, as blindness should be handled in handle_disabilities() diff --git a/code/modules/mob/living/simple_animal/friendly/farm_animals.dm b/code/modules/mob/living/simple_animal/friendly/farm_animals.dm index 2c20f561d1d45..7d6fa03205d35 100644 --- a/code/modules/mob/living/simple_animal/friendly/farm_animals.dm +++ b/code/modules/mob/living/simple_animal/friendly/farm_animals.dm @@ -253,16 +253,24 @@ var/global/chicken_count = 0 E.pixel_x = rand(-6,6) E.pixel_y = rand(-6,6) if(chicken_count < MAX_CHICKENS && prob(10)) - GLOB.processing_objects.Add(E) + E.amount_grown = 1 + START_PROCESSING(SSobj, E) -/obj/item/weapon/reagent_containers/food/snacks/egg/var/amount_grown = 0 -/obj/item/weapon/reagent_containers/food/snacks/egg/process() +/obj/item/weapon/reagent_containers/food/snacks/egg + var/amount_grown = 0 + +/obj/item/weapon/reagent_containers/food/snacks/egg/Destroy() + if(amount_grown) + STOP_PROCESSING(SSobj, src) + . = ..() + +/obj/item/weapon/reagent_containers/food/snacks/egg/Process() if(chicken_count < MAX_CHICKENS && isturf(loc)) amount_grown += rand(1,2) if(amount_grown >= 100) visible_message("[src] hatches with a quiet cracking sound.") new /mob/living/simple_animal/chick(get_turf(src)) - GLOB.processing_objects.Remove(src) + STOP_PROCESSING(SSobj, src) qdel(src) else - GLOB.processing_objects.Remove(src) + STOP_PROCESSING(SSobj, src) diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 337146d222ab0..5794719f3c1bb 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -1,5 +1,5 @@ /mob/Destroy()//This makes sure that mobs with clients/keys are not just deleted from the game. - GLOB.mob_list -= src + STOP_PROCESSING(SSmobs, src) GLOB.dead_mob_list_ -= src GLOB.living_mob_list_ -= src unset_machine() @@ -42,8 +42,9 @@ ability_master = null zone_sel = null -/mob/New() - GLOB.mob_list += src +/mob/Initialize() + . = ..() + START_PROCESSING(SSmobs, src) ..() /mob/Initialize() @@ -138,8 +139,8 @@ O.show_message(message, AUDIBLE_MESSAGE, deaf_message, VISIBLE_MESSAGE) /mob/proc/findname(msg) - for(var/mob/M in GLOB.mob_list) - if (M.real_name == text("[]", msg)) + for(var/mob/M in SSmobs.mob_list) + if (M.real_name == msg) return M return 0 @@ -447,7 +448,7 @@ namecounts[name] = 1 creatures[name] = O - for(var/mob/M in sortAtom(GLOB.mob_list)) + for(var/mob/M in sortAtom(SSmobs.mob_list)) var/name = M.name if (names.Find(name)) namecounts[name]++ diff --git a/code/modules/mob/observer/freelook/ai/cameranet.dm b/code/modules/mob/observer/freelook/ai/cameranet.dm index 13291325b9fdd..bde34a77b7a8e 100644 --- a/code/modules/mob/observer/freelook/ai/cameranet.dm +++ b/code/modules/mob/observer/freelook/ai/cameranet.dm @@ -22,10 +22,12 @@ return FALSE . = ..(c, c.can_use()) if(.) - dd_insertObjectList(cameras, c) + ADD_SORTED(cameras, c, /proc/cmp_camera_ctag_asc) else if(isAI(c)) var/mob/living/silicon/AI = c return ..(AI, AI.stat != DEAD) + else + ..() // Add a camera to a chunk. @@ -35,3 +37,5 @@ if(isAI(c)) var/mob/living/silicon/AI = c return ..(AI, AI.stat != DEAD) + else + ..() diff --git a/code/modules/mob/observer/freelook/ai/update_triggers.dm b/code/modules/mob/observer/freelook/ai/update_triggers.dm index 38363b7345267..c4409a1134c81 100644 --- a/code/modules/mob/observer/freelook/ai/update_triggers.dm +++ b/code/modules/mob/observer/freelook/ai/update_triggers.dm @@ -11,7 +11,7 @@ if(!isnull(net)) net.update_visibility(src) -/obj/machinery/camera/New() +/obj/machinery/camera/Initialize() . = ..() var/datum/visualnet/camera/net = get_cameranet() if(!isnull(net)) diff --git a/code/modules/mob/observer/virtual/base.dm b/code/modules/mob/observer/virtual/base.dm index b9b93fa3e752d..51f2e8d102314 100644 --- a/code/modules/mob/observer/virtual/base.dm +++ b/code/modules/mob/observer/virtual/base.dm @@ -23,11 +23,14 @@ var/list/all_virtual_listeners = list() src.host = host GLOB.moved_event.register(host, src, /atom/movable/proc/move_to_turf_or_null) - GLOB.mob_list -= src all_virtual_listeners += src update_icon() +/mob/observer/virtual/Initialize() + . = ..() + STOP_PROCESSING(SSmobs, src) + /mob/observer/virtual/Destroy() GLOB.moved_event.unregister(host, src, /atom/movable/proc/move_to_turf_or_null) all_virtual_listeners -= src @@ -54,11 +57,8 @@ var/list/all_virtual_listeners = list() /atom/movable/Initialize() . = ..() - if(ispath(virtual_mob)) - if(shall_have_virtual_mob()) - virtual_mob = new virtual_mob(get_turf(src), src) - else - virtual_mob = null + if(shall_have_virtual_mob()) + virtual_mob = new virtual_mob(get_turf(src), src) /atom/movable/Destroy() if(virtual_mob && !ispath(virtual_mob)) @@ -70,4 +70,4 @@ var/list/all_virtual_listeners = list() return TRUE /mob/shall_have_virtual_mob() - return (src in GLOB.mob_list) + return ispath(initial(virtual_mob)) diff --git a/code/modules/power/pacman2.dm b/code/modules/power/pacman2.dm index 6304ac2654715..b28ec31fe7204 100644 --- a/code/modules/power/pacman2.dm +++ b/code/modules/power/pacman2.dm @@ -83,7 +83,7 @@ to_chat(user, "You secure the generator to the floor.") else to_chat(user, "You unsecure the generator from the floor.") - makepowernets() + SSmachines.makepowernets() else if(istype(O, /obj/item/weapon/screwdriver)) open = !open playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1) diff --git a/code/modules/power/power.dm b/code/modules/power/power.dm index 4195562332940..962d66b868ce5 100644 --- a/code/modules/power/power.dm +++ b/code/modules/power/power.dm @@ -235,41 +235,6 @@ . += C return . -/hook/startup/proc/buildPowernets() - return makepowernets() - -var/global/list/cable_list_late_init = list() - -// rebuild all power networks from scratch - only called at world creation or by the admin verb -/proc/makepowernets() - for(var/datum/powernet/PN in GLOB.powernets) - qdel(PN) - GLOB.powernets.Cut() - cable_list_late_init.Cut() - - for(var/obj/structure/cable/PC in cable_list) - if(PC.d1 == UP || PC.d1 == DOWN) - cable_list_late_init.Add(PC) - else if(!PC.powernet) - var/datum/powernet/NewPN = new() - NewPN.add_cable(PC) - propagate_network(PC,PC.powernet) - - if(ticker && ticker.current_state >= GAME_STATE_SETTING_UP) - makepowernets_late_init() - - return 1 - -/hook/game_initialised/proc/buildPowernets_late_init() - return makepowernets_late_init() - -/proc/makepowernets_late_init() - for(var/obj/structure/cable/PC in cable_list_late_init) - //just connect both directions, this proc safety checks if its already connected - PC.mergeConnectedNetworks(PC.d1) - PC.mergeConnectedNetworks(PC.d2) - return 1 - //remove the old powernet and replace it with a new one throughout the network. /proc/propagate_network(var/obj/O, var/datum/powernet/PN) //world.log << "propagating new network" diff --git a/code/modules/power/powernet.dm b/code/modules/power/powernet.dm index 8a7ddbed87f7f..8562b578bb8f3 100644 --- a/code/modules/power/powernet.dm +++ b/code/modules/power/powernet.dm @@ -21,7 +21,7 @@ var/problem = 0 // If this is not 0 there is some sort of issue in the powernet. Monitors will display warnings. /datum/powernet/New() - GLOB.powernets += src + START_PROCESSING_POWERNET(src) ..() /datum/powernet/Destroy() @@ -31,7 +31,7 @@ for(var/obj/machinery/power/M in nodes) nodes -= M M.powernet = null - GLOB.powernets -= src + STOP_PROCESSING_POWERNET(src) return ..() //Returns the amount of excess power (before refunding to SMESs) from last tick. diff --git a/code/modules/power/turbine.dm b/code/modules/power/turbine.dm index 0593cdd00bac6..c4f2feaa19ced 100644 --- a/code/modules/power/turbine.dm +++ b/code/modules/power/turbine.dm @@ -216,16 +216,15 @@ -/obj/machinery/computer/turbine_computer/New() - ..() - spawn(5) - for(var/obj/machinery/compressor/C in GLOB.machines) - if(id == C.comp_id) - compressor = C - doors = new /list() - for(var/obj/machinery/door/blast/P in GLOB.machines) - if(P.id == id) - doors += P +/obj/machinery/computer/turbine_computer/Initialize() + . = ..() + for(var/obj/machinery/compressor/C in SSmachines.machinery) + if(id == C.comp_id) + compressor = C + doors = new /list() + for(var/obj/machinery/door/blast/P in SSmachines.machinery) + if(P.id == id) + doors += P /* /obj/machinery/computer/turbine_computer/attackby(I as obj, user as mob) diff --git a/code/modules/projectiles/guns/energy/temperature.dm b/code/modules/projectiles/guns/energy/temperature.dm index cfa5e6d43ac5a..abc8c761bce58 100644 --- a/code/modules/projectiles/guns/energy/temperature.dm +++ b/code/modules/projectiles/guns/energy/temperature.dm @@ -15,14 +15,14 @@ cell_type = /obj/item/weapon/cell/high -/obj/item/weapon/gun/energy/temperature/New() - ..() +/obj/item/weapon/gun/energy/temperature/Initialize() + . = ..() GLOB.processing_objects.Add(src) /obj/item/weapon/gun/energy/temperature/Destroy() GLOB.processing_objects.Remove(src) - ..() + . = ..() /obj/item/weapon/gun/energy/temperature/attack_self(mob/living/user as mob) diff --git a/code/modules/projectiles/guns/launcher/alien.dm b/code/modules/projectiles/guns/launcher/alien.dm index ea130b6049614..16b9ba4ad7c81 100644 --- a/code/modules/projectiles/guns/launcher/alien.dm +++ b/code/modules/projectiles/guns/launcher/alien.dm @@ -6,8 +6,8 @@ var/ammo_type var/ammo_name -/obj/item/weapon/gun/launcher/alien/New() - ..() +/obj/item/weapon/gun/launcher/alien/Initialize() + . = ..() GLOB.processing_objects.Add(src) last_regen = world.time diff --git a/code/modules/projectiles/guns/magnetic/magnetic.dm b/code/modules/projectiles/guns/magnetic/magnetic.dm index a7b0b05a01b83..f2ade38b094ff 100644 --- a/code/modules/projectiles/guns/magnetic/magnetic.dm +++ b/code/modules/projectiles/guns/magnetic/magnetic.dm @@ -21,22 +21,20 @@ var/power_per_tick // Capacitor charge per process(). Updated based on capacitor rating. /obj/item/weapon/gun/magnetic/Initialize() + START_PROCESSING(SSobj, src) if(capacitor) power_per_tick = (power_cost*0.15) * capacitor.rating update_icon() . = ..() -/obj/item/weapon/gun/magnetic/New() - ..() - GLOB.processing_objects |= src - /obj/item/weapon/gun/magnetic/Destroy() + STOP_PROCESSING(SSobj, src) QDEL_NULL(cell) QDEL_NULL(loaded) QDEL_NULL(capacitor) . = ..() -/obj/item/weapon/gun/magnetic/process() +/obj/item/weapon/gun/magnetic/Process() if(capacitor) if(cell) if(capacitor.charge < capacitor.max_charge && cell.checked_use(power_per_tick)) diff --git a/code/modules/research/message_server.dm b/code/modules/research/message_server.dm index 8070eb11fb14b..112ab7633e5e0 100644 --- a/code/modules/research/message_server.dm +++ b/code/modules/research/message_server.dm @@ -74,14 +74,12 @@ var/global/list/obj/machinery/message_server/message_servers = list() decryptkey = GenerateKey() send_pda_message("System Administrator", "system", "This is an automated message. The messaging system is functioning correctly.") ..() - return /obj/machinery/message_server/Destroy() message_servers -= src ..() - return -/obj/machinery/message_server/process() +/obj/machinery/message_server/Process() if(active && (stat & (BROKEN|NOPOWER))) active = 0 power_failure = 10 @@ -290,7 +288,7 @@ var/obj/machinery/blackbox_recorder/blackbox var/pda_msg_amt = 0 var/rc_msg_amt = 0 - for(var/obj/machinery/message_server/MS in GLOB.machines) + for(var/obj/machinery/message_server/MS in SSmachines.machinery) if(MS.pda_msgs.len > pda_msg_amt) pda_msg_amt = MS.pda_msgs.len if(MS.rc_msgs.len > rc_msg_amt) diff --git a/code/modules/shield_generators/handheld_diffuser.dm b/code/modules/shield_generators/handheld_diffuser.dm index 8bae4c6b5f333..b9494fbd21000 100644 --- a/code/modules/shield_generators/handheld_diffuser.dm +++ b/code/modules/shield_generators/handheld_diffuser.dm @@ -18,8 +18,8 @@ ..() /obj/item/weapon/shield_diffuser/Destroy() - qdel(cell) cell = null + QDEL_NULL(cell) if(enabled) GLOB.processing_objects.Remove(src) . = ..() diff --git a/code/modules/turbolift/turbolift.dm b/code/modules/turbolift/turbolift.dm index 2ce90867776d1..bed99216b3c2d 100644 --- a/code/modules/turbolift/turbolift.dm +++ b/code/modules/turbolift/turbolift.dm @@ -99,7 +99,7 @@ origin.move_contents_to(destination) if((locate(/obj/machinery/power) in destination) || (locate(/obj/structure/cable) in destination)) - makepowernets() + SSmachines.makepowernets() current_floor = next_floor control_panel_interior.visible_message("The elevator [moving_upwards ? "rises" : "descends"] smoothly.") diff --git a/code/modules/xenoarcheaology/artifacts/artifact.dm b/code/modules/xenoarcheaology/artifacts/artifact.dm index c7888d54db8fa..e26e495cc9871 100644 --- a/code/modules/xenoarcheaology/artifacts/artifact.dm +++ b/code/modules/xenoarcheaology/artifacts/artifact.dm @@ -49,13 +49,13 @@ my_effect.trigger = pick(TRIGGER_WATER, TRIGGER_ACID, TRIGGER_VOLATILE, TRIGGER_TOXIN) /obj/machinery/artifact/Destroy() - qdel(my_effect) - qdel(secondary_effect) my_effect = null secondary_effect = null + QDEL_NULL(my_effect) + QDEL_NULL(secondary_effect) . = ..() -/obj/machinery/artifact/process() +/obj/machinery/artifact/Process() var/turf/L = loc if(!istype(L)) // We're inside a container or on null turf, either way stop processing effects return diff --git a/code/modules/xenoarcheaology/finds/special.dm b/code/modules/xenoarcheaology/finds/special.dm index 35c222ad90a6b..08c75fc16bebf 100644 --- a/code/modules/xenoarcheaology/finds/special.dm +++ b/code/modules/xenoarcheaology/finds/special.dm @@ -5,12 +5,12 @@ /obj/item/weapon/reagent_containers/glass/replenishing var/spawning_id -/obj/item/weapon/reagent_containers/glass/replenishing/New() - ..() - GLOB.processing_objects.Add(src) +/obj/item/weapon/reagent_containers/glass/replenishing/Initialize() + . = ..() spawning_id = pick(/datum/reagent/blood,/datum/reagent/water/holywater,/datum/reagent/lube,/datum/reagent/soporific,/datum/reagent/ethanol,/datum/reagent/drink/ice,/datum/reagent/glycerol,/datum/reagent/fuel,/datum/reagent/space_cleaner) + START_PROCESSING(SSobj,src) -/obj/item/weapon/reagent_containers/glass/replenishing/process() +/obj/item/weapon/reagent_containers/glass/replenishing/Process() reagents.add_reagent(spawning_id, 0.3) @@ -21,17 +21,17 @@ var/last_twitch = 0 var/max_stored_messages = 100 -/obj/item/clothing/mask/gas/poltergeist/New() - GLOB.processing_objects.Add(src) +/obj/item/clothing/mask/gas/poltergeist/Initialize() GLOB.listening_objects += src - ..() + START_PROCESSING(SSobj, src) + . = ..() /obj/item/clothing/mask/gas/poltergeist/Destroy() - GLOB.processing_objects.Remove(src) GLOB.listening_objects -= src + STOP_PROCESSING(SSobj, src) return ..() -/obj/item/clothing/mask/gas/poltergeist/process() +/obj/item/clothing/mask/gas/poltergeist/Process() if(heard_talk.len && istype(src.loc, /mob/living) && prob(10)) var/mob/living/M = src.loc M.say(pick(heard_talk)) @@ -61,17 +61,19 @@ var/wight_check_index = 1 var/list/shadow_wights = list() -/obj/item/weapon/vampiric/New() - ..() - GLOB.processing_objects.Add(src) +/obj/item/weapon/vampiric/Iniitalize() + . = ..() GLOB.listening_objects += src + START_PROCESSING(SSobj, src) + /obj/item/weapon/vampiric/Destroy() GLOB.processing_objects.Remove(src) GLOB.listening_objects -= src + STOP_PROCESSING(SSobj, src) return ..() -/obj/item/weapon/vampiric/process() +/obj/item/weapon/vampiric/Process() //see if we've identified anyone nearby if(world.time - last_bloodcall > bloodcall_interval && nearby_mobs.len) var/mob/living/carbon/human/M = pop(nearby_mobs) @@ -154,16 +156,16 @@ var/turf/target_turf var/loc_last_process -/obj/effect/decal/cleanable/blood/splatter/animated/New() - ..() - GLOB.processing_objects.Add(src) +/obj/effect/decal/cleanable/blood/splatter/animated/Initialize() + . = ..() + START_PROCESSING(SSobj, src) loc_last_process = src.loc /obj/effect/decal/cleanable/blood/splatter/animated/Destroy() - GLOB.processing_objects.Remove(src) + STOP_PROCESSING(SSobj, src) return ..() -/obj/effect/decal/cleanable/blood/splatter/animated/process() +/obj/effect/decal/cleanable/blood/splatter/animated/Process() if(target_turf && src.loc != target_turf) step_towards(src,target_turf) if(src.loc == loc_last_process) @@ -189,14 +191,15 @@ icon_state = "shade" density = 1 -/obj/effect/shadow_wight/New() - GLOB.processing_objects.Add(src) +/obj/effect/shadow_wight/Initialize() + . = ..() + START_PROCESSING(SSobj, src) /obj/effect/shadow_wight/Destroy() - GLOB.processing_objects.Remove(src) + STOP_PROCESSING(SSobj, src) return ..() -/obj/effect/shadow_wight/process() +/obj/effect/shadow_wight/Process() if(src.loc) src.loc = get_turf(pick(orange(1,src))) var/mob/living/carbon/M = locate() in src.loc diff --git a/code/modules/xenoarcheaology/tools/ano_device_battery.dm b/code/modules/xenoarcheaology/tools/ano_device_battery.dm index bd4c7d8bd06b3..10df125eed92c 100644 --- a/code/modules/xenoarcheaology/tools/ano_device_battery.dm +++ b/code/modules/xenoarcheaology/tools/ano_device_battery.dm @@ -32,9 +32,9 @@ var/turf/archived_loc var/energy_consumed_on_touch = 100 -/obj/item/weapon/anodevice/New() - ..() - GLOB.processing_objects.Add(src) +/obj/item/weapon/anodevice/Initialize() + . = ..() + START_PROCESSING(SSobj, src) /obj/item/weapon/anodevice/attackby(var/obj/I as obj, var/mob/user as mob) if(istype(I, /obj/item/weapon/anobattery)) @@ -78,7 +78,7 @@ user << browse(dat, "window=anodevice;size=400x500") onclose(user, "anodevice") -/obj/item/weapon/anodevice/process() +/obj/item/weapon/anodevice/Process() if(activated) if(inserted_battery && inserted_battery.battery_effect && (inserted_battery.stored_charge > 0) ) //make sure the effect is active @@ -190,7 +190,7 @@ icon_state = "anodev[round(p,25)]" /obj/item/weapon/anodevice/Destroy() - GLOB.processing_objects.Remove(src) + STOP_PROCESSING(SSobj, src) ..() /obj/item/weapon/anodevice/attack(mob/living/M as mob, mob/living/user as mob, def_zone) diff --git a/code/modules/xenoarcheaology/tools/tools.dm b/code/modules/xenoarcheaology/tools/tools.dm index e7583761ffce5..954d407c07458 100644 --- a/code/modules/xenoarcheaology/tools/tools.dm +++ b/code/modules/xenoarcheaology/tools/tools.dm @@ -249,15 +249,15 @@ var/scan_ticks = 0 var/obj/item/device/radio/target_radio -/obj/item/device/beacon_locator/New() +/obj/item/device/beacon_locator/Initialize() ..() - GLOB.processing_objects.Add(src) + START_PROCESSING(SSobj, src) /obj/item/device/beacon_locator/Destroy() - GLOB.processing_objects.Remove(src) + STOP_PROCESSING(SSobj, src) return ..() -/obj/item/device/beacon_locator/process() +/obj/item/device/beacon_locator/Process() if(target_radio) set_dir(get_dir(src,target_radio)) switch(get_dist(src,target_radio)) @@ -276,7 +276,7 @@ if(prob(scan_ticks * 10)) spawn(0) set background = 1 - if(GLOB.processing_objects.Find(src)) + if(src in SSobj.processing) //scan radios in the world to try and find one var/cur_dist = 999 for(var/obj/item/device/radio/beacon/R in world) diff --git a/code/world.dm b/code/world.dm index c48f884501424..c2818d245a575 100644 --- a/code/world.dm +++ b/code/world.dm @@ -1,71 +1,7 @@ #define WORLD_ICON_SIZE 32 -/var/server_name = "Halo Spacestation Evolved" - -/var/game_id = null -/hook/global_init/proc/generate_gameid() - if(game_id != null) - return - game_id = "" - - var/list/c = list("a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0") - var/l = c.len - - var/t = world.timeofday - for(var/_ = 1 to 4) - game_id = "[c[(t % l) + 1]][game_id]" - t = round(t / l) - game_id = "-[game_id]" - t = round(world.realtime / (10 * 60 * 60 * 24)) - for(var/_ = 1 to 3) - game_id = "[c[(t % l) + 1]][game_id]" - t = round(t / l) - return 1 - -// Find mobs matching a given string -// -// search_string: the string to search for, in params format; for example, "some_key;mob_name" -// restrict_type: A mob type to restrict the search to, or null to not restrict -// -// Partial matches will be found, but exact matches will be preferred by the search -// -// Returns: A possibly-empty list of the strongest matches -/proc/text_find_mobs(search_string, restrict_type = null) - var/list/search = params2list(search_string) - var/list/ckeysearch = list() - for(var/text in search) - ckeysearch += ckey(text) - - var/list/match = list() - - for(var/mob/M in GLOB.mob_list) - if(restrict_type && !istype(M, restrict_type)) - continue - var/strings = list(M.name, M.ckey) - if(M.mind) - strings += M.mind.assigned_role - strings += M.mind.special_role - if(ishuman(M)) - var/mob/living/carbon/human/H = M - if(H.species) - strings += H.species.name - for(var/text in strings) - if(ckey(text) in ckeysearch) - match[M] += 10 // an exact match is far better than a partial one - else - for(var/searchstr in search) - if(findtext(text, searchstr)) - match[M] += 1 - - var/maxstrength = 0 - for(var/mob/M in match) - maxstrength = max(match[M], maxstrength) - for(var/mob/M in match) - if(match[M] < maxstrength) - match -= M - - return match - +//This file is just for the necessary /world definition +//Try looking in game/world.dm /world mob = /mob/new_player @@ -77,675 +13,4 @@ fps = 20 #ifdef GC_FAILURE_HARD_LOOKUP loop_checks = FALSE -#endif - -#define RECOMMENDED_VERSION 513 -#if DM_VERSION < RECOMMENDED_VERSION -#error Your BYOND is out of date! -#endif -/world/New() - //Log startup times - var/startedAt = world.timeofday - - //set window title - name = "[server_name] - [GLOB.using_map.full_name]" - - //logs - SetupLogs() - var/date_string = time2text(world.realtime, "YYYY/MM-Month/DD-Day") - href_logfile = file("data/logs/[date_string] hrefs.htm") - diary = file("data/logs/[date_string].log") - diary << "[log_end]\n[log_end]\nStarting up. (ID: [game_id]) [time2text(world.timeofday, "hh:mm.ss")][log_end]\n---------------------[log_end]" - changelog_hash = md5('html/changelog.html') //used for telling if the changelog has changed recently - - if(byond_version < RECOMMENDED_VERSION) - world.log << "Your server's byond version does not meet the recommended requirements for this server. Please update BYOND" - - config.post_load() - - if(config && config.server_name != null && config.server_suffix && world.port > 0) - // dumb and hardcoded but I don't care~ - config.server_name += " #[(world.port % 1000) / 100]" - - if(config && config.log_runtime) - var/runtime_log = file("data/logs/runtime/[date_string]_[time2text(world.timeofday, "hh:mm")]_[game_id].log") - runtime_log << "Game [game_id] starting up at [time2text(world.timeofday, "hh:mm.ss")]" - log = runtime_log - - callHook("startup") - //Emergency Fix - load_mods() - //end-emergency fix - - var/timeToStart = world.timeofday - startedAt - log_world("Startup took: [timeToStart] seconds") - - . = ..() - -#ifdef UNIT_TEST - log_unit_test("Unit Tests Enabled. This will destroy the world when testing is complete.") - load_unit_test_changes() -#endif - - // Set up roundstart seed list. - plant_controller = new() - - // This is kinda important. Set up details of what the hell things are made of. - populate_material_list() - - if(config.generate_map) - if(GLOB.using_map.perform_map_generation()) - GLOB.using_map.refresh_mining_turfs() - GLOB.using_map.build_exoplanets() - - // Create robolimbs for chargen. - populate_robolimb_list() - - processScheduler = new - master_controller = new /datum/controller/game_controller() - - processScheduler.deferSetupFor(/datum/controller/process/ticker) - processScheduler.setup() - Master.Initialize(10, FALSE) - -#ifdef UNIT_TEST - spawn(1) - initialize_unit_tests() -#endif - - spawn(3000) //so we aren't adding to the round-start lag - if(config.ToRban) - ToRban_autoupdate() - -#undef RECOMMENDED_VERSION - -var/world_topic_spam_protect_ip = "0.0.0.0" -var/world_topic_spam_protect_time = world.timeofday - -/world/Topic(T, addr, master, key) - diary << "TOPIC: \"[T]\", from:[addr], master:[master], key:[key][log_end]" - - if (T == "ping") - var/x = 1 - for (var/client/C) - x++ - return x - - else if(T == "players") - var/n = 0 - for(var/mob/M in GLOB.player_list) - if(M.client) - n++ - return n - - else if (copytext(T,1,7) == "status") - var/input[] = params2list(T) - var/list/s = list() - s["version"] = game_version - s["mode"] = PUBLIC_GAME_MODE - s["respawn"] = config.abandon_allowed - s["enter"] = config.enter_allowed - s["vote"] = config.allow_vote_mode - s["ai"] = config.allow_ai - s["host"] = host ? host : null - - // This is dumb, but spacestation13.com's banners break if player count isn't the 8th field of the reply, so... this has to go here. - s["players"] = 0 - s["stationtime"] = stationtime2text() - s["roundduration"] = roundduration2text() - s["map"] = GLOB.using_map.full_name - - if(input["status"] == "2") - var/list/players = list() - var/list/admins = list() - - for(var/client/C in GLOB.clients) - if(C.holder) - if(C.is_stealthed()) - continue - admins[C.key] = C.holder.rank - players += C.key - - s["players"] = players.len - s["playerlist"] = list2params(players) - s["admins"] = admins.len - s["adminlist"] = list2params(admins) - else - var/n = 0 - var/admins = 0 - - for(var/client/C in GLOB.clients) - if(C.holder) - if(C.is_stealthed()) - continue //so stealthmins aren't revealed by the hub - admins++ - s["player[n]"] = C.key - n++ - - s["players"] = n - s["admins"] = admins - - return list2params(s) - - else if(T == "revision") - var/list/L = list() - L["gameid"] = game_id - L["dm_version"] = DM_VERSION // DreamMaker version compiled in - L["dd_version"] = world.byond_version // DreamDaemon version running on - - if(revdata.revision) - L["revision"] = revdata.revision - L["branch"] = revdata.branch - L["date"] = revdata.date - else - L["revision"] = "unknown" - - return list2params(L) - - else if(copytext(T,1,5) == "laws") - var/input[] = params2list(T) - if(input["key"] != config.comms_password) - if(world_topic_spam_protect_ip == addr && abs(world_topic_spam_protect_time - world.time) < 50) - - spawn(50) - world_topic_spam_protect_time = world.time - return "Bad Key (Throttled)" - - world_topic_spam_protect_time = world.time - world_topic_spam_protect_ip = addr - - return "Bad Key" - - var/list/match = text_find_mobs(input["laws"], /mob/living/silicon) - - if(!match.len) - return "No matches" - else if(match.len == 1) - var/mob/living/silicon/S = match[1] - var/info = list() - info["name"] = S.name - info["key"] = S.key - - if(!S.laws) - info["laws"] = null - return list2params(info) - - var/list/lawset_parts = list( - "ion" = S.laws.ion_laws, - "inherent" = S.laws.inherent_laws, - "supplied" = S.laws.supplied_laws - ) - - for(var/law_type in lawset_parts) - var/laws = list() - for(var/datum/ai_law/L in lawset_parts[law_type]) - laws += L.law - info[law_type] = list2params(laws) - - info["zero"] = S.laws.zeroth_law ? S.laws.zeroth_law.law : null - - return list2params(info) - - else - var/list/ret = list() - for(var/mob/M in match) - ret[M.key] = M.name - return list2params(ret) - - else if(copytext(T,1,5) == "info") - var/input[] = params2list(T) - if(input["key"] != config.comms_password) - if(world_topic_spam_protect_ip == addr && abs(world_topic_spam_protect_time - world.time) < 50) - - spawn(50) - world_topic_spam_protect_time = world.time - return "Bad Key (Throttled)" - - world_topic_spam_protect_time = world.time - world_topic_spam_protect_ip = addr - - return "Bad Key" - - var/list/match = text_find_mobs(input["info"]) - - if(!match.len) - return "No matches" - else if(match.len == 1) - var/mob/M = match[1] - var/info = list() - info["key"] = M.key - info["name"] = M.name == M.real_name ? M.name : "[M.name] ([M.real_name])" - info["role"] = M.mind ? (M.mind.assigned_role ? M.mind.assigned_role : "No role") : "No mind" - var/turf/MT = get_turf(M) - info["loc"] = M.loc ? "[M.loc]" : "null" - info["turf"] = MT ? "[MT] @ [MT.x], [MT.y], [MT.z]" : "null" - info["area"] = MT ? "[MT.loc]" : "null" - info["antag"] = M.mind ? (M.mind.special_role ? M.mind.special_role : "Not antag") : "No mind" - info["hasbeenrev"] = M.mind ? M.mind.has_been_rev : "No mind" - info["stat"] = M.stat - info["type"] = M.type - if(isliving(M)) - var/mob/living/L = M - info["damage"] = list2params(list( - oxy = L.getOxyLoss(), - tox = L.getToxLoss(), - fire = L.getFireLoss(), - brute = L.getBruteLoss(), - clone = L.getCloneLoss(), - brain = L.getBrainLoss() - )) - if(ishuman(M)) - var/mob/living/carbon/human/H = M - info["species"] = H.species.name - else - info["species"] = "non-human" - else - info["damage"] = "non-living" - info["species"] = "non-human" - info["gender"] = M.gender - return list2params(info) - else - var/list/ret = list() - for(var/mob/M in match) - ret[M.key] = M.name - return list2params(ret) - - else if(copytext(T,1,9) == "adminmsg") - /* - We got an adminmsg from IRC bot lets split the input then validate the input. - expected output: - 1. adminmsg = ckey of person the message is to - 2. msg = contents of message, parems2list requires - 3. validatationkey = the key the bot has, it should match the gameservers commspassword in it's configuration. - 4. sender = the ircnick that send the message. - */ - - - var/input[] = params2list(T) - if(input["key"] != config.comms_password) - if(world_topic_spam_protect_ip == addr && abs(world_topic_spam_protect_time - world.time) < 50) - - spawn(50) - world_topic_spam_protect_time = world.time - return "Bad Key (Throttled)" - - world_topic_spam_protect_time = world.time - world_topic_spam_protect_ip = addr - - return "Bad Key" - - var/client/C - var/req_ckey = ckey(input["adminmsg"]) - - for(var/client/K in GLOB.clients) - if(K.ckey == req_ckey) - C = K - break - if(!C) - return "No client with that name on server" - - var/rank = input["rank"] - if(!rank) - rank = "Admin" - if(rank == "Unknown") - rank = "Staff" - - var/message = "[rank] PM from [input["sender"]]: [input["msg"]]" - var/amessage = "[rank] PM from [input["sender"]] to [key_name(C)] : [input["msg"]]" - - C.received_irc_pm = world.time - C.irc_admin = input["sender"] - - sound_to(C, 'sound/effects/adminhelp.ogg') - to_chat(C, message) - - for(var/client/A in GLOB.admins) - if(A != C) - to_chat(A, amessage) - return "Message Successful" - - else if(copytext(T,1,6) == "notes") - /* - We got a request for notes from the IRC Bot - expected output: - 1. notes = ckey of person the notes lookup is for - 2. validationkey = the key the bot has, it should match the gameservers commspassword in it's configuration. - */ - var/input[] = params2list(T) - if(input["key"] != config.comms_password) - if(world_topic_spam_protect_ip == addr && abs(world_topic_spam_protect_time - world.time) < 50) - - spawn(50) - world_topic_spam_protect_time = world.time - return "Bad Key (Throttled)" - - world_topic_spam_protect_time = world.time - world_topic_spam_protect_ip = addr - return "Bad Key" - - return show_player_info_irc(ckey(input["notes"])) - - else if(copytext(T,1,4) == "age") - var/input[] = params2list(T) - if(input["key"] != config.comms_password) - if(world_topic_spam_protect_ip == addr && abs(world_topic_spam_protect_time - world.time) < 50) - spawn(50) - world_topic_spam_protect_time = world.time - return "Bad Key (Throttled)" - - world_topic_spam_protect_time = world.time - world_topic_spam_protect_ip = addr - return "Bad Key" - - var/age = get_player_age(input["age"]) - if(isnum(age)) - if(age >= 0) - return "[age]" - else - return "Ckey not found" - else - return "Database connection failed or not set up" - - else if(copytext(T,1,14) == "placepermaban") - var/input[] = params2list(T) - if(!config.ban_comms_password) - return "Not enabled" - if(input["bankey"] != config.ban_comms_password) - if(world_topic_spam_protect_ip == addr && abs(world_topic_spam_protect_time - world.time) < 50) - spawn(50) - world_topic_spam_protect_time = world.time - return "Bad Key (Throttled)" - - world_topic_spam_protect_time = world.time - world_topic_spam_protect_ip = addr - return "Bad Key" - - var/target = ckey(input["target"]) - - var/client/C - for(var/client/K in GLOB.clients) - if(K.ckey == target) - C = K - break - if(!C) - return "No client with that name found on server" - if(!C.mob) - return "Client missing mob" - - if(!_DB_ban_record(input["id"], "0", "127.0.0.1", 1, C.mob, -1, input["reason"])) - return "Save failed" - ban_unban_log_save("[input["id"]] has permabanned [C.ckey]. - Reason: [input["reason"]] - This is a ban until appeal.") - notes_add(target,"[input["id"]] has permabanned [C.ckey]. - Reason: [input["reason"]] - This is a ban until appeal.",input["id"]) - qdel(C) - - else if(copytext(T,1,19) == "prometheus_metrics") - var/input[] = params2list(T) - if(input["key"] != config.comms_password) - if(world_topic_spam_protect_ip == addr && abs(world_topic_spam_protect_time - world.time) < 50) - spawn(50) - world_topic_spam_protect_time = world.time - return "Bad Key (Throttled)" - - world_topic_spam_protect_time = world.time - world_topic_spam_protect_ip = addr - return "Bad Key" - - if(!GLOB || !GLOB.prometheus_metrics) - return "Metrics not ready" - - return GLOB.prometheus_metrics.collect() - - -/world/Reboot(var/reason) - /*spawn(0) - sound_to(world, sound(pick('sound/AI/newroundsexy.ogg','sound/misc/apcdestroyed.ogg','sound/misc/bangindonk.ogg')))// random end sounds!! - LastyBatsy - - */ - - processScheduler.stop() - - if(config.server) //if you set a server location in config.txt, it sends you there instead of trying to reconnect to the same world address. -- NeoFite - for(var/client/C in GLOB.clients) - send_link(C, "byond://[config.server]") - - if(config.wait_for_sigusr1_reboot && reason != 3) - text2file("foo", "reboot_called") - to_world("World reboot waiting for external scripts. Please be patient.") - return - - ..(reason) - -/world/Del() - callHook("shutdown") - return ..() - -/hook/startup/proc/loadMode() - world.load_mode() - return 1 - -/world/proc/load_mode() - if(!fexists("data/mode.txt")) - return - - var/list/Lines = file2list("data/mode.txt") - if(Lines.len) - if(Lines[1]) - master_mode = Lines[1] - log_misc("Saved mode is '[master_mode]'") - -/world/proc/save_mode(var/the_mode) - var/F = file("data/mode.txt") - fdel(F) - F << the_mode - -/hook/startup/proc/loadMOTD() - world.load_motd() - return 1 - -/world/proc/load_motd() - join_motd = file2text("config/motd.txt") - - -/proc/load_configuration() - if(config) - qdel(config) - config = new /datum/configuration() - config.load("config/config.txt") - config.load("config/game_options.txt","game_options") - config.loadsql("config/dbconfig.txt") - config.load_event("config/custom_event.txt") - -/hook/startup/proc/loadMods() - world.load_mods() - world.load_mentors() // no need to write another hook. - return 1 - -/world/proc/load_mods() - if(config.admin_legacy_system) - var/text = file2text("config/moderators.txt") - if (!text) - error("Failed to load config/mods.txt") - else - var/list/lines = splittext(text, "\n") - for(var/line in lines) - if (!line) - continue - - if (copytext(line, 1, 2) == ";") - continue - - var/title = "Moderator" - var/rights = admin_ranks[title] - - var/ckey = copytext(line, 1, length(line)+1) - var/datum/admins/D = new /datum/admins(title, rights, ckey) - D.associate(GLOB.ckey_directory[ckey]) - -/world/proc/load_mentors() - if(config.admin_legacy_system) - var/text = file2text("config/mentors.txt") - if (!text) - error("Failed to load config/mentors.txt") - else - var/list/lines = splittext(text, "\n") - for(var/line in lines) - if (!line) - continue - if (copytext(line, 1, 2) == ";") - continue - - var/title = "Mentor" - var/rights = admin_ranks[title] - - var/ckey = copytext(line, 1, length(line)+1) - var/datum/admins/D = new /datum/admins(title, rights, ckey) - D.associate(GLOB.ckey_directory[ckey]) - -/world/proc/update_status() - var/s = "" - - if (config && config.server_name) - s += "[config.server_name] — " - - s += "[station_name()]"; - s += " (Forums|Discord)" - - var/list/features = list() - - if(ticker) - if(master_mode) - features += master_mode - else - features += "STARTING" - - if (!config.enter_allowed) - features += "closed" - - features += config.abandon_allowed ? "respawn" : "no respawn" - - if (config && config.allow_vote_mode) - features += "vote" - - if (config && config.allow_ai) - features += "AI allowed" - - /*var/n = 0 - for (var/mob/M in GLOB.player_list) - if (M.client) - n++ - - if (n > 1) - features += "~[n] players" - else if (n > 0) - features += "~[n] player"*/ - - if (config && config.hostedby) - features += "hosted by [config.hostedby]" - - if (features) - s += ": [jointext(features, ", ")]" - - /* does this help? I do not know */ - if (src.status != s) - src.status = s - -/world/proc/SetupLogs() - GLOB.log_directory = "data/logs/[time2text(world.realtime, "YYYY/MM/DD")]/round-" - if(game_id) - GLOB.log_directory += "[game_id]" - else - GLOB.log_directory += "[replacetext(time_stamp(), ":", ".")]" - - GLOB.world_runtime_log << "\n\nStarting up round ID [game_id]. [time_stamp()]\n---------------------" - -#define FAILED_DB_CONNECTION_CUTOFF 5 -var/failed_db_connections = 0 -var/failed_old_db_connections = 0 - -/hook/startup/proc/connectDB() - if(!config.do_sql_connection) - return 1 - if(!setup_database_connection()) - world.log << "Your server failed to establish a connection with the feedback database." - else - world.log << "Feedback database connection established." - return 1 - -proc/setup_database_connection() - - if(failed_db_connections > FAILED_DB_CONNECTION_CUTOFF) //If it failed to establish a connection more than 5 times in a row, don't bother attempting to conenct anymore. - return 0 - - if(!dbcon) - dbcon = new() - - var/user = sqlfdbklogin - var/pass = sqlfdbkpass - var/db = sqlfdbkdb - var/address = sqladdress - var/port = sqlport - - dbcon.Connect("dbi:mysql:[db]:[address]:[port]","[user]","[pass]") - . = dbcon.IsConnected() - if ( . ) - failed_db_connections = 0 //If this connection succeeded, reset the failed connections counter. - else - failed_db_connections++ //If it failed, increase the failed connections counter. - world.log << dbcon.ErrorMsg() - - return . - -//This proc ensures that the connection to the feedback database (global variable dbcon) is established -proc/establish_db_connection() - if(failed_db_connections > FAILED_DB_CONNECTION_CUTOFF) - return 0 - - if(!dbcon || !dbcon.IsConnected()) - return setup_database_connection() - else - return 1 - - -/hook/startup/proc/connectOldDB() - if(!setup_old_database_connection()) - world.log << "Your server failed to establish a connection with the SQL database." - else - world.log << "SQL database connection established." - return 1 - -//These two procs are for the old database, while it's being phased out. See the tgstation.sql file in the SQL folder for more information. -proc/setup_old_database_connection() - - if(failed_old_db_connections > FAILED_DB_CONNECTION_CUTOFF) //If it failed to establish a connection more than 5 times in a row, don't bother attempting to conenct anymore. - return 0 - - if(!dbcon_old) - dbcon_old = new() - - var/user = sqllogin - var/pass = sqlpass - var/db = sqldb - var/address = sqladdress - var/port = sqlport - - dbcon_old.Connect("dbi:mysql:[db]:[address]:[port]","[user]","[pass]") - . = dbcon_old.IsConnected() - if ( . ) - failed_old_db_connections = 0 //If this connection succeeded, reset the failed connections counter. - else - failed_old_db_connections++ //If it failed, increase the failed connections counter. - world.log << dbcon.ErrorMsg() - - return . - -//This proc ensures that the connection to the feedback database (global variable dbcon) is established -proc/establish_old_db_connection() - if(failed_old_db_connections > FAILED_DB_CONNECTION_CUTOFF) - return 0 - - if(!dbcon_old || !dbcon_old.IsConnected()) - return setup_old_database_connection() - else - return 1 - -#undef FAILED_DB_CONNECTION_CUTOFF +#endif \ No newline at end of file diff --git a/tools/GenerateGlobalVarAccess/generateGlobalVars.bat b/tools/GenerateGlobalVarAccess/generateGlobalVars.bat index ac2f675bc510f..7a377b67dd18b 100644 --- a/tools/GenerateGlobalVarAccess/generateGlobalVars.bat +++ b/tools/GenerateGlobalVarAccess/generateGlobalVars.bat @@ -1,3 +1,3 @@ @echo off -call C:\Python27\python.exe gen_globals.py ../../baystation12.dme ../../code/_helpers/global_access.dm +call python gen_globals.py ../../baystation12.dme ../../code/_helpers/global_access.dm pause From 38fe46e10b89d28761dbdad51d270d61fd5d0f41 Mon Sep 17 00:00:00 2001 From: X0-11 Date: Mon, 3 Jun 2024 18:07:05 +0100 Subject: [PATCH 2/9] conversion --- code/_helpers/game.dm | 2 +- code/_helpers/unsorted.dm | 6 +- code/_onclick/hud/ability_screen_objects.dm | 2 +- .../ProcessScheduler/core/process.dm | 2 +- .../ProcessScheduler/core/processScheduler.dm | 6 +- code/controllers/Processes/Shuttle.dm | 2 +- code/controllers/Processes/ai.dm | 2 +- code/controllers/Processes/alarm.dm | 2 +- .../controllers/Processes/emergencyShuttle.dm | 2 +- code/controllers/Processes/scheduler.dm | 6 +- code/controllers/Processes/supply.dm | 2 +- code/controllers/Processes/tgui.dm | 2 +- code/controllers/Processes/ticker.dm | 2 +- code/controllers/Processes/turf.dm | 2 +- code/controllers/Processes/vote.dm | 2 +- code/controllers/autotransfer.dm | 6 +- code/controllers/evacuation/evacuation.dm | 2 +- .../evacuation/evacuation_shuttle.dm | 2 +- code/controllers/master_controller.dm | 8 +- code/controllers/shuttle_controller.dm | 4 +- code/controllers/subsystems/event.dm | 4 +- code/controllers/voting.dm | 4 +- code/controllers/voting/initiate_vote.dm | 2 +- code/controllers/voting/process.dm | 4 +- code/controllers/voting/vote_types.dm | 2 +- code/datums/ai/ai.dm | 2 +- code/datums/chatmessage.dm | 6 +- code/datums/datacore.dm | 4 +- code/datums/datum.dm | 4 +- code/datums/helper_datums/global_iterator.dm | 4 +- code/datums/repositories/crew/crew.dm | 2 +- code/game/antagonist/alien/borer.dm | 2 +- code/game/antagonist/alien/xenomorph.dm | 2 +- code/game/antagonist/station/cultist.dm | 2 +- code/game/antagonist/station/loyalist.dm | 2 +- code/game/antagonist/station/revolutionary.dm | 2 +- code/game/area/Space Station 13 areas.dm | 4 +- code/game/gamemodes/cult/hell_universe.dm | 2 +- code/game/gamemodes/cult/narsie.dm | 4 +- .../endgame/bluespace_jump/bluespace_jump.dm | 2 +- .../nuclear_explosion/nuclear_explosion.dm | 2 +- .../endgame/supermatter_cascade/blob.dm | 2 +- .../endgame/supermatter_cascade/universe.dm | 6 +- code/game/gamemodes/events.dm | 6 +- code/game/gamemodes/events/power_failure.dm | 10 +-- code/game/gamemodes/game_mode.dm | 6 +- code/game/gamemodes/game_mode_latespawn.dm | 4 +- code/game/gamemodes/gameticker.dm | 14 ++-- .../gamemodes/malfunction/malf_research.dm | 4 +- .../malfunction/malf_research_ability.dm | 2 +- .../newmalf_ability_trees/HELPERS.dm | 8 +- .../tree_manipulation.dm | 6 +- .../newmalf_ability_trees/tree_networking.dm | 4 +- code/game/gamemodes/meteor/meteor.dm | 4 +- code/game/gamemodes/nuclear/pinpointer.dm | 2 +- code/game/gamemodes/objective.dm | 2 +- code/game/machinery/Sleeper.dm | 2 +- code/game/machinery/adv_med.dm | 2 +- code/game/machinery/alarm.dm | 8 +- code/game/machinery/atmo_control.dm | 6 +- code/game/machinery/atmoalter/canister.dm | 2 +- code/game/machinery/atmoalter/meter.dm | 2 +- .../atmoalter/portable_atmospherics.dm | 2 +- code/game/machinery/atmoalter/pump.dm | 2 +- code/game/machinery/atmoalter/scrubber.dm | 6 +- code/game/machinery/atmoalter/zvent.dm | 2 +- code/game/machinery/bluespacerelay.dm | 2 +- code/game/machinery/camera/camera.dm | 4 +- code/game/machinery/camera/tracking.dm | 2 +- code/game/machinery/cell_charger.dm | 2 +- code/game/machinery/computer/Operating.dm | 2 +- code/game/machinery/computer/computer.dm | 2 +- code/game/machinery/computer/pod.dm | 4 +- code/game/machinery/cryo.dm | 2 +- code/game/machinery/cryopod.dm | 2 +- code/game/machinery/door_control.dm | 6 +- code/game/machinery/doors/airlock.dm | 4 +- code/game/machinery/doors/airlock_control.dm | 4 +- code/game/machinery/doors/brigdoors.dm | 6 +- code/game/machinery/doors/door.dm | 2 +- code/game/machinery/doors/firedoor.dm | 2 +- code/game/machinery/doors/simple.dm | 2 +- .../airlock_controllers_dummy.dm | 4 +- .../airlock_docking_controller.dm | 4 +- .../embedded_controller/airlock_program.dm | 2 +- .../embedded_controller/docking_program.dm | 76 +++++++++---------- .../docking_program_multi.dm | 2 +- .../embedded_controller_base.dm | 6 +- .../embedded_program_base.dm | 2 +- code/game/machinery/flasher.dm | 2 +- code/game/machinery/floodlight.dm | 2 +- code/game/machinery/floor_light.dm | 2 +- code/game/machinery/hologram.dm | 4 +- code/game/machinery/holosign.dm | 2 +- code/game/machinery/igniter.dm | 6 +- code/game/machinery/iv_drip.dm | 2 +- code/game/machinery/kitchen/smartfridge.dm | 4 +- code/game/machinery/machinery.dm | 2 +- code/game/machinery/newscaster.dm | 2 +- code/game/machinery/nuclear_bomb.dm | 2 +- code/game/machinery/oxygen_pump.dm | 2 +- code/game/machinery/portable_turret.dm | 2 +- code/game/machinery/recharger.dm | 2 +- code/game/machinery/rechargestation.dm | 2 +- code/game/machinery/resleever.dm | 2 +- code/game/machinery/spaceheater.dm | 2 +- code/game/machinery/status_display.dm | 2 +- code/game/machinery/status_display_ai.dm | 4 +- code/game/machinery/suit_storage_unit.dm | 2 +- code/game/machinery/supplybeacon.dm | 2 +- code/game/machinery/syndicatebeacon.dm | 2 +- .../machinery/telecomms/telecomunications.dm | 2 +- code/game/machinery/vending.dm | 2 +- .../mecha/equipment/tools/medical_tools.dm | 4 +- code/game/mecha/equipment/tools/tools.dm | 8 +- code/game/mecha/mech_bay.dm | 2 +- code/game/mecha/mech_fabricator.dm | 2 +- code/game/mecha/mecha.dm | 8 +- .../effects/decals/Cleanable/humans.dm | 10 +-- code/game/objects/effects/force_portal.dm | 6 +- code/game/objects/effects/manifest.dm | 2 +- code/game/objects/effects/spiders.dm | 14 ++-- code/game/objects/items/devices/PDA/cart.dm | 2 +- .../objects/items/devices/PDA/manifest.dm | 4 +- code/game/objects/items/devices/aicard.dm | 6 +- code/game/objects/items/devices/flashlight.dm | 12 +-- code/game/objects/items/devices/geiger.dm | 2 +- .../objects/items/devices/radio/intercom.dm | 6 +- .../objects/items/devices/suit_cooling.dm | 2 +- .../items/devices/suit_sensor_jammer.dm | 4 +- code/game/objects/items/devices/t_scanner.dm | 6 +- code/game/objects/items/devices/uplink.dm | 6 +- code/game/objects/items/glassjar.dm | 4 +- code/game/objects/items/weapons/candle.dm | 4 +- .../objects/items/weapons/cigs_lighters.dm | 20 ++--- code/game/objects/items/weapons/defib.dm | 8 +- code/game/objects/items/weapons/ecigs.dm | 8 +- .../objects/items/weapons/flamethrower.dm | 6 +- .../items/weapons/grenades/supermatter.dm | 6 +- .../weapons/implants/implants/death_alarm.dm | 10 +-- .../weapons/material/material_weapons.dm | 6 +- .../objects/items/weapons/melee/energy.dm | 4 +- .../objects/items/weapons/storage/boxes.dm | 2 +- .../game/objects/items/weapons/tanks/tanks.dm | 6 +- code/game/objects/items/weapons/tools.dm | 8 +- .../crates_lockers/closets/statue.dm | 6 +- code/game/objects/structures/watercloset.dm | 2 +- code/game/response_team.dm | 4 +- code/game/supplyshuttle.dm | 2 +- code/game/turfs/biome.dm | 6 +- code/game/turfs/daynight_cycle.dm | 4 +- code/game/turfs/simulated/walls.dm | 2 +- code/game/turfs/turf.dm | 2 +- code/game/world.dm | 2 +- code/modules/ZAS/Fire.dm | 4 +- code/modules/admin/admin.dm | 10 +-- code/modules/admin/admin_verbs.dm | 8 +- code/modules/admin/buildmode/edit.dm | 2 +- code/modules/admin/holoverbs.dm | 2 +- .../admin/secrets/admin_secrets/list_dna.dm | 2 +- .../admin_secrets/list_fingerprints.dm | 2 +- .../secrets/admin_secrets/prison_warp.dm | 2 +- .../fun_secrets/turn_humans_into_corgies.dm | 2 +- .../fun_secrets/turn_humans_into_monkeys.dm | 2 +- code/modules/admin/verbs/adminhelp.dm | 2 +- code/modules/admin/verbs/adminjump.dm | 4 +- code/modules/admin/verbs/adminpm.dm | 2 +- code/modules/admin/verbs/atmosdebug.dm | 2 +- code/modules/admin/verbs/debug.dm | 16 ++-- code/modules/admin/verbs/massmodvar.dm | 24 +++--- code/modules/admin/verbs/possess.dm | 2 +- code/modules/admin/verbs/randomverbs.dm | 24 +++--- code/modules/alarm/alarm.dm | 2 +- code/modules/alarm/alarm_handler.dm | 4 +- code/modules/assembly/holder.dm | 4 +- code/modules/assembly/proximity.dm | 6 +- code/modules/assembly/signaler.dm | 10 +-- code/modules/assembly/timer.dm | 6 +- code/modules/atmospherics/atmospherics.dm | 2 +- .../components/binary_devices/circulator.dm | 2 +- .../components/binary_devices/dp_vent_pump.dm | 2 +- .../components/binary_devices/passive_gate.dm | 2 +- .../components/omni_devices/omni_base.dm | 2 +- .../components/trinary_devices/filter.dm | 4 +- .../components/trinary_devices/mixer.dm | 2 +- .../modules/atmospherics/components/tvalve.dm | 2 +- .../components/unary/cold_sink.dm | 2 +- .../components/unary/heat_source.dm | 2 +- .../components/unary/outlet_injector.dm | 20 ++--- .../components/unary/vent_scrubber.dm | 2 +- .../atmospherics/datum_pipe_network.dm | 2 +- code/modules/atmospherics/datum_pipeline.dm | 6 +- code/modules/atmospherics/pipes.dm | 14 ++-- .../awaymissions/bluespaceartillery.dm | 2 +- code/modules/awaymissions/gateway.dm | 2 +- code/modules/blob/blob.dm | 6 +- code/modules/clothing/head/misc_special.dm | 6 +- .../clothing/spacesuits/rig/modules/combat.dm | 2 +- .../spacesuits/rig/modules/computer.dm | 4 +- .../spacesuits/rig/modules/modules.dm | 2 +- .../clothing/spacesuits/rig/modules/ninja.dm | 2 +- code/modules/clothing/spacesuits/rig/rig.dm | 8 +- .../detectivework/microscope/dnascanner.dm | 2 +- code/modules/detectivework/tools/rag.dm | 10 +-- code/modules/detectivework/tools/uvlight.dm | 6 +- code/modules/economy/ATM.dm | 2 +- code/modules/events/blob.dm | 4 +- code/modules/events/brand_intelligence.dm | 2 +- code/modules/events/electrical_storm.dm | 2 +- code/modules/events/event.dm | 2 +- code/modules/events/event_container.dm | 2 +- code/modules/events/ion_storm.dm | 2 +- code/modules/events/meteors.dm | 2 +- code/modules/food/replicator.dm | 2 +- code/modules/halo/NPC/npc_overmind.dm | 6 +- code/modules/halo/admin/start_flood_attack.dm | 6 +- .../halo/antag_overrides/objectives.dm | 2 +- code/modules/halo/clothing/jetpacks.dm | 8 +- code/modules/halo/clothing/special_armour.dm | 2 +- .../halo/comms/machines/_overmap_comms.dm | 2 +- code/modules/halo/comms/telecomms_jammers.dm | 4 +- code/modules/halo/covenant/cycling_trader.dm | 4 +- .../halo/covenant/invasion_bomb_respawner.dm | 8 +- .../modules/halo/covenant/invasion_scanner.dm | 10 +-- .../covenant/manufactory/item_manufactory.dm | 2 +- .../halo/covenant/simple_mobs/overmind.dm | 2 +- .../halo/covenant/species/sangheili/organs.dm | 2 +- .../structures_machines/energybarricade.dm | 12 +-- .../structures_machines/pillar_lift.dm | 8 +- .../structures_machines/plasmabattery.dm | 6 +- .../structures_machines/repulsor_engine.dm | 2 +- .../structures_machines/weapon_rack.dm | 6 +- .../halo/demolitions/demolition_manager.dm | 6 +- code/modules/halo/demolitions/pinpointer.dm | 8 +- code/modules/halo/factions/_controller.dm | 2 +- .../halo/factions/objectives/_objectives.dm | 6 +- code/modules/halo/factions/process.dm | 4 +- code/modules/halo/factions/quest/process.dm | 2 +- code/modules/halo/flood/flood_spawn.dm | 10 +-- code/modules/halo/flood/flood_spawn_proxy.dm | 6 +- code/modules/halo/flood/types/infestor.dm | 2 +- .../halo/forerunner/sentinel_spawner.dm | 4 +- .../halo/forerunner/species/knight/knight.dm | 4 +- .../halo/leader_support/supply_drop_evac.dm | 4 +- .../modules/halo/machinery/atmos_blastdoor.dm | 6 +- .../halo/machinery/autosurgeon/process.dm | 2 +- .../machinery/boarding_beacon_launcher.dm | 8 +- .../halo/machinery/buttons/alertbutton.dm | 2 +- .../halo/machinery/medical/thermopod.dm | 2 +- .../halo/machinery/unsc_plasma_charger.dm | 2 +- code/modules/halo/misc/Fire_simple.dm | 6 +- .../misc/armourspecials/armourspecials.dm | 2 +- .../misc/armourspecials/cloaking_limited.dm | 6 +- .../halo/misc/armourspecials/holo_decoy.dm | 6 +- .../halo/misc/armourspecials/regeneration.dm | 6 +- .../halo/misc/armourspecials/shields.dm | 6 +- code/modules/halo/misc/capture_node.dm | 10 +-- code/modules/halo/misc/fakewall.dm | 4 +- code/modules/halo/misc/flaming_torch.dm | 6 +- code/modules/halo/misc/gas_collector.dm | 2 +- code/modules/halo/misc/gas_geyser.dm | 4 +- code/modules/halo/misc/loot_distributor.dm | 4 +- code/modules/halo/misc/payload.dm | 10 +-- code/modules/halo/misc/xeno_plant.dm | 6 +- code/modules/halo/overmap/base_npc_ships.dm | 10 +-- code/modules/halo/overmap/combat_npc_ship.dm | 2 +- code/modules/halo/overmap/fusion_thruster.dm | 2 +- .../modules/halo/overmap/nav_data_computer.dm | 6 +- .../halo/overmap/npc_shipmap_handler.dm | 2 +- .../modules/halo/overmap/slipspace/process.dm | 2 +- code/modules/halo/overmap/slipspace_drive.dm | 8 +- code/modules/halo/overmap/umbilicals.dm | 6 +- .../halo/overmap/weapons/Energy_projector.dm | 6 +- code/modules/halo/overmap/weapons/MAC.dm | 4 +- .../halo/overmap/weapons/auto_mac_program.dm | 6 +- .../halo/overmap/weapons/laser_designator.dm | 4 +- .../halo/overmap/weapons/proj_deck_gun.dm | 6 +- code/modules/halo/power/cooling_manifold.dm | 2 +- code/modules/halo/power/reactor.dm | 2 +- code/modules/halo/power/reactor_simple.dm | 2 +- .../halo/research/machines/dissembler.dm | 6 +- .../research/machines/protolathe/process.dm | 2 +- .../halo/squads/squad-waypoint-controller.dm | 7 +- .../halo/structures/blast_door_control.dm | 4 +- code/modules/halo/trade/trade_shuttle.dm | 2 +- code/modules/halo/unsc/overmind.dm | 2 +- code/modules/halo/unsc/spartan_gear.dm | 4 +- .../halo/vehicles/rearm_repair_station.dm | 12 +-- code/modules/halo/vehicles/vehiclebase.dm | 6 +- code/modules/halo/weapons/automated_AA.dm | 6 +- code/modules/halo/weapons/autoturret.dm | 8 +- code/modules/halo/weapons/covenant/ammo.dm | 6 +- code/modules/halo/weapons/covenant/melee.dm | 8 +- .../halo/weapons/covenant/shield_gauntlet.dm | 6 +- code/modules/halo/weapons/drop_pod_beacon.dm | 6 +- .../halo/weapons/forerunner/grenade.dm | 4 +- code/modules/halo/weapons/gun_overheat.dm | 6 +- code/modules/halo/weapons/landmine.dm | 6 +- code/modules/halo/weapons/turrets/turret.dm | 6 +- code/modules/holodeck/HolodeckControl.dm | 2 +- .../modules/hydroponics/beekeeping/beehive.dm | 2 +- code/modules/hydroponics/seed_controller.dm | 6 +- code/modules/hydroponics/seed_machines.dm | 2 +- .../hydroponics/spreading/spreading_growth.dm | 2 +- code/modules/hydroponics/trays/tray.dm | 2 +- .../modules/hydroponics/trays/tray_process.dm | 2 +- code/modules/hydroponics/trays/tray_soil.dm | 2 +- .../integrated_electronics/input_output.dm | 2 +- .../modules/integrated_electronics/sensors.dm | 6 +- code/modules/integrated_electronics/time.dm | 13 ++-- .../lighting/lighting_source_ambient.dm | 6 +- code/modules/mining/drilling/drill.dm | 2 +- code/modules/mining/lift.dm | 8 +- code/modules/mining/machine_processing.dm | 2 +- code/modules/mining/machine_stacking.dm | 2 +- code/modules/mining/machine_unloading.dm | 2 +- code/modules/mob/grab/grab_datum.dm | 2 +- code/modules/mob/grab/grab_object.dm | 4 +- code/modules/mob/hear_say.dm | 2 +- code/modules/mob/holder.dm | 6 +- .../mob/living/carbon/human/human_organs.dm | 4 +- code/modules/mob/living/carbon/viruses.dm | 2 +- code/modules/mob/living/silicon/ai/ai.dm | 2 +- code/modules/mob/living/silicon/ai/login.dm | 2 +- .../silicon/robot/drone/drone_manufacturer.dm | 4 +- .../mob/living/silicon/robot/robot_items.dm | 2 +- code/modules/mob/mob_helpers.dm | 4 +- code/modules/mob/observer/ghost/ghost.dm | 2 +- code/modules/modular_computers/NTNet/NTNet.dm | 2 +- .../modular_computers/NTNet/NTNet_relay.dm | 2 +- .../computers/modular_computer/core.dm | 6 +- .../file_system/programs/command/comm.dm | 2 +- .../programs/engineering/atmos_control.dm | 6 +- .../programs/engineering/power_monitor.dm | 2 +- .../programs/engineering/rcon_console.dm | 4 +- .../engineering/supermatter_monitor.dm | 2 +- .../programs/medical/suit_sensors.dm | 4 +- code/modules/multiz/pipes.dm | 2 +- code/modules/organs/external/_external.dm | 2 +- code/modules/organs/external/machine.dm | 2 +- code/modules/organs/internal/_internal.dm | 2 +- code/modules/organs/internal/appendix.dm | 2 +- code/modules/organs/internal/borer.dm | 2 +- code/modules/organs/internal/brain.dm | 2 +- code/modules/organs/internal/eyes.dm | 2 +- code/modules/organs/internal/heart.dm | 2 +- code/modules/organs/internal/kidneys.dm | 2 +- code/modules/organs/internal/liver.dm | 2 +- code/modules/organs/internal/lungs.dm | 2 +- code/modules/organs/organ.dm | 6 +- code/modules/organs/subtypes/nabber.dm | 10 +-- code/modules/overmap/exoplanets/exoplanet.dm | 6 +- code/modules/overmap/sectors.dm | 6 +- code/modules/overmap/ships/computers/helm.dm | 2 +- code/modules/overmap/ships/engines/engine.dm | 6 +- code/modules/overmap/ships/ship.dm | 10 +-- code/modules/power/antimatter/control.dm | 2 +- code/modules/power/antimatter/fuel.dm | 2 +- code/modules/power/antimatter/shielding.dm | 4 +- code/modules/power/apc.dm | 2 +- code/modules/power/batteryrack.dm | 2 +- code/modules/power/breaker_box.dm | 2 +- code/modules/power/cable_logic.dm | 24 +++--- code/modules/power/debug_items.dm | 4 +- code/modules/power/fusion/_setup.dm | 4 +- code/modules/power/fusion/core/_core.dm | 4 +- code/modules/power/fusion/core/core_field.dm | 6 +- .../fusion/fuel_assembly/fuel_assembly.dm | 6 +- .../fusion/fuel_assembly/fuel_injector.dm | 2 +- .../modules/power/fusion/gyrotron/gyrotron.dm | 2 +- code/modules/power/generator.dm | 2 +- code/modules/power/gravitygenerator.dm | 2 +- code/modules/power/port_gen.dm | 2 +- code/modules/power/sensors/powernet_sensor.dm | 2 +- .../power/sensors/sensor_monitoring.dm | 2 +- code/modules/power/singularity/collector.dm | 2 +- code/modules/power/singularity/emitter.dm | 2 +- .../power/singularity/field_generator.dm | 4 +- code/modules/power/singularity/generator.dm | 2 +- .../particle_accelerator/particle_control.dm | 2 +- code/modules/power/singularity/singularity.dm | 8 +- code/modules/power/smes.dm | 2 +- code/modules/power/smes_construction.dm | 2 +- code/modules/power/solar.dm | 6 +- code/modules/power/terminal.dm | 2 +- code/modules/power/turbine.dm | 6 +- code/modules/projectiles/guns/energy.dm | 14 ++-- .../projectiles/guns/energy/nuclear.dm | 2 +- .../projectiles/guns/energy/temperature.dm | 6 +- .../projectiles/guns/launcher/alien.dm | 6 +- code/modules/projectiles/projectile.dm | 8 +- .../modules/projectiles/projectile/bullets.dm | 2 +- .../targeting/targeting_overlay.dm | 6 +- code/modules/reagents/Chemistry-Holder.dm | 2 +- code/modules/reagents/Chemistry-Recipes.dm | 2 +- .../reagents/reagent_containers/borghydro.dm | 6 +- code/modules/recycling/conveyor2.dm | 4 +- code/modules/recycling/disposal.dm | 2 +- code/modules/research/circuitprinter.dm | 2 +- code/modules/research/protolathe.dm | 2 +- code/modules/research/rdconsole.dm | 6 +- code/modules/research/server.dm | 16 ++-- .../security levels/security levels.dm | 2 +- .../shield_generators/floor_diffuser.dm | 2 +- .../shield_generators/handheld_diffuser.dm | 8 +- .../shield_generators/shield_generator.dm | 2 +- code/modules/shieldgen/emergency_shield.dm | 4 +- code/modules/shieldgen/shieldwallgen.dm | 4 +- code/modules/shuttles/escape_pods.dm | 2 +- code/modules/shuttles/shuttle_autodock.dm | 2 +- code/modules/spells/spell_code.dm | 4 +- code/modules/spells/spellbook.dm | 8 +- code/modules/supermatter/supermatter.dm | 8 +- code/modules/tgui/process.dm | 4 +- code/modules/tgui/tgui.dm | 2 +- code/modules/virus2/analyser.dm | 2 +- code/modules/virus2/centrifuge.dm | 2 +- code/modules/virus2/curer.dm | 2 +- code/modules/virus2/disease2.dm | 2 +- code/modules/virus2/diseasesplicer.dm | 2 +- code/modules/virus2/dishincubator.dm | 2 +- code/modules/virus2/isolator.dm | 2 +- .../xenoarcheaology/artifacts/artifact.dm | 4 +- .../xenoarcheaology/artifacts/autocloner.dm | 2 +- .../xenoarcheaology/artifacts/replicator.dm | 2 +- code/modules/xenoarcheaology/effect.dm | 2 +- .../xenoarcheaology/effects/forcefield.dm | 2 +- code/modules/xenoarcheaology/finds/special.dm | 5 +- code/modules/xenoarcheaology/finds/talking.dm | 8 +- .../tools/ano_device_battery.dm | 2 +- .../tools/artifact_analyser.dm | 2 +- .../tools/artifact_harvester.dm | 4 +- .../tools/geosample_scanner.dm | 2 +- .../tools/suspension_generator.dm | 2 +- code/procs/hud.dm | 2 +- code/unit_tests/map_tests.dm | 6 +- maps/_gamemodes/firefight/overmind.dm | 2 +- maps/_gamemodes/firefight/process.dm | 2 +- maps/_gamemodes/invasion/gamemode.dm | 2 +- .../packwar/mode_packwar_process.dm | 2 +- maps/_gamemodes/slayer.dm | 2 +- .../system_conquest/system_conquest.dm | 4 +- maps/base_assault_neutral_base/gm.dm | 2 +- maps/doisac/mercenaries_spawn.dm | 4 +- maps/operation_trebuchet/insurrection_gm.dm | 2 +- maps/slayer/slayer_itemspawn_markers.dm | 6 +- maps/unsc_achlys/achlys_gamemode.dm | 2 +- maps/unsc_achlys/achlys_gm.dm | 2 +- 448 files changed, 959 insertions(+), 962 deletions(-) diff --git a/code/_helpers/game.dm b/code/_helpers/game.dm index 4ce5729c41990..7dc6a36a6720a 100644 --- a/code/_helpers/game.dm +++ b/code/_helpers/game.dm @@ -347,7 +347,7 @@ proc/isInSight(var/atom/A, var/atom/B) return get_step(start, EAST) /proc/get_mob_by_key(var/key) - for(var/mob/M in GLOB.mob_list) + for(var/mob/M in SSmobs.mob_list) if(M.ckey == lowertext(key)) return M return null diff --git a/code/_helpers/unsorted.dm b/code/_helpers/unsorted.dm index 34b22d9e2649f..b4211264320f3 100644 --- a/code/_helpers/unsorted.dm +++ b/code/_helpers/unsorted.dm @@ -420,7 +420,7 @@ Turf and target are seperate in case you want to teleport some distance from a t //Orders mobs by type then by name /proc/sortmobs() var/list/moblist = list() - var/list/sortmob = sortAtom(GLOB.mob_list) + var/list/sortmob = sortAtom(SSmobs.mob_list) for(var/mob/observer/eye/M in sortmob) moblist.Add(M) for(var/mob/living/silicon/ai/M in sortmob) @@ -832,7 +832,7 @@ proc/oview_or_orange(distance = world.view , center = usr , type) proc/get_mob_with_client_list() var/list/mobs = list() - for(var/mob/M in GLOB.mob_list) + for(var/mob/M in SSmobs.mob_list) if (M.client) mobs += M return mobs @@ -1136,7 +1136,7 @@ GLOBAL_DATUM_INIT(dview_mob, /mob/dview, new) /mob/dview/Initialize() ..() // We don't want to be in any mob lists; we're a dummy not a mob. - GLOB.mob_list -= src + SSmobs.mob_list -= src // call to generate a stack trace and print to runtime logs /proc/crash_with(msg) diff --git a/code/_onclick/hud/ability_screen_objects.dm b/code/_onclick/hud/ability_screen_objects.dm index e7dd78240abac..ef48f58a5c043 100644 --- a/code/_onclick/hud/ability_screen_objects.dm +++ b/code/_onclick/hud/ability_screen_objects.dm @@ -408,5 +408,5 @@ /obj/screen/movable/ability_master/proc/silence_spells(var/amount) for(var/obj/screen/ability/spell/spell in spell_objects) spell.spell.silenced = amount - spell.spell.process() + spell.spell.Process() spell.update_charge(1) \ No newline at end of file diff --git a/code/controllers/ProcessScheduler/core/process.dm b/code/controllers/ProcessScheduler/core/process.dm index dd1734ad7a11f..2c6e9bb2d321a 100644 --- a/code/controllers/ProcessScheduler/core/process.dm +++ b/code/controllers/ProcessScheduler/core/process.dm @@ -127,7 +127,7 @@ /datum/controller/process/proc/setup() -/datum/controller/process/proc/process() +/datum/controller/process/Process() started() doWork() finished() diff --git a/code/controllers/ProcessScheduler/core/processScheduler.dm b/code/controllers/ProcessScheduler/core/processScheduler.dm index 073c16d6e2efa..9754d8c8d8263 100644 --- a/code/controllers/ProcessScheduler/core/processScheduler.dm +++ b/code/controllers/ProcessScheduler/core/processScheduler.dm @@ -95,9 +95,9 @@ var/global/datum/controller/processScheduler/processScheduler timeAllowanceMax = world.tick_lag updateStartDelays() spawn(0) - process() + Process() -/datum/controller/processScheduler/proc/process() +/datum/controller/processScheduler/Process() updateCurrentTickData() for(var/i=world.tick_lag,i scheduled_task.trigger_time) unschedule(scheduled_task) scheduled_task.pre_process() - scheduled_task.process() + scheduled_task.Process() scheduled_task.post_process() catch(var/exception/e) catchException(e, last_object) @@ -96,7 +96,7 @@ /datum/scheduled_task/proc/pre_process() task_triggered_event.raise_event(src) -/datum/scheduled_task/proc/process() +/datum/scheduled_task/Process() if(procedure) call(procedure)(arglist(arguments)) @@ -120,7 +120,7 @@ source = null return ..() -/datum/scheduled_task/source/process() +/datum/scheduled_task/source/Process() call(source, procedure)(arglist(arguments)) /datum/scheduled_task/source/proc/source_destroyed() diff --git a/code/controllers/Processes/supply.dm b/code/controllers/Processes/supply.dm index 891a511ec6d62..5c6ef044b1ab7 100644 --- a/code/controllers/Processes/supply.dm +++ b/code/controllers/Processes/supply.dm @@ -3,4 +3,4 @@ schedule_interval = 300 // every 30 seconds /datum/controller/process/supply/doWork() - supply_controller.process() \ No newline at end of file + supply_controller.Process() \ No newline at end of file diff --git a/code/controllers/Processes/tgui.dm b/code/controllers/Processes/tgui.dm index 4081818b3c873..b8d7b227a61ac 100644 --- a/code/controllers/Processes/tgui.dm +++ b/code/controllers/Processes/tgui.dm @@ -17,7 +17,7 @@ var/global/datum/controller/process/tgui/tgui_process for(var/gui in processing_uis) var/datum/tgui/ui = gui if(ui && ui.user && ui.src_object) - ui.process() + ui.Process() SCHECK continue processing_uis.Remove(ui) diff --git a/code/controllers/Processes/ticker.dm b/code/controllers/Processes/ticker.dm index 6fa6d43237d1d..4ce2580ce575a 100644 --- a/code/controllers/Processes/ticker.dm +++ b/code/controllers/Processes/ticker.dm @@ -29,7 +29,7 @@ var/global/datum/controller/process/ticker/tickerProcess lastTickerTime = currentTime - ticker.process() + ticker.Process() /datum/controller/process/ticker/proc/getLastTickerTimeDuration() return lastTickerTimeDuration diff --git a/code/controllers/Processes/turf.dm b/code/controllers/Processes/turf.dm index 8dc99b3ad43cf..87fb1d688376d 100644 --- a/code/controllers/Processes/turf.dm +++ b/code/controllers/Processes/turf.dm @@ -7,7 +7,7 @@ var/global/list/turf/processing_turfs = list() /datum/controller/process/turf/doWork() for(last_object in processing_turfs) var/turf/T = last_object - if(T.process() == PROCESS_KILL) + if(T.Process() == PROCESS_KILL) processing_turfs.Remove(T) SCHECK diff --git a/code/controllers/Processes/vote.dm b/code/controllers/Processes/vote.dm index 5df5ce697921d..e09be952d6735 100644 --- a/code/controllers/Processes/vote.dm +++ b/code/controllers/Processes/vote.dm @@ -3,4 +3,4 @@ schedule_interval = 10 // every second /datum/controller/process/vote/doWork() - vote.process() + vote.Process() diff --git a/code/controllers/autotransfer.dm b/code/controllers/autotransfer.dm index 05ac8232397e4..e9180114d88ef 100644 --- a/code/controllers/autotransfer.dm +++ b/code/controllers/autotransfer.dm @@ -5,13 +5,13 @@ var/datum/controller/transfer_controller/transfer_controller /datum/controller/transfer_controller/New() timerbuffer = config.vote_autotransfer_initial - GLOB.processing_objects += src + START_PROCESSING(SSobj, src) /datum/controller/transfer_controller/Destroy() - GLOB.processing_objects -= src + STOP_PROCESSING(SSobj, src) . = ..() -/datum/controller/transfer_controller/proc/process() +/datum/controller/transfer_controller/Process() if (time_till_transfer_vote() <= 0) vote.autotransfer() timerbuffer += config.vote_autotransfer_interval diff --git a/code/controllers/evacuation/evacuation.dm b/code/controllers/evacuation/evacuation.dm index 3e783091e1af4..d2155aa399f06 100644 --- a/code/controllers/evacuation/evacuation.dm +++ b/code/controllers/evacuation/evacuation.dm @@ -151,7 +151,7 @@ var/datum/evacuation_controller/evacuation_controller /datum/evacuation_controller/proc/finish_evacuation() state = EVAC_COMPLETE -/datum/evacuation_controller/proc/process() +/datum/evacuation_controller/Process() if(state == EVAC_PREPPING && recall && world.time >= auto_recall_time) cancel_evacuation() diff --git a/code/controllers/evacuation/evacuation_shuttle.dm b/code/controllers/evacuation/evacuation_shuttle.dm index fc99e804bbccc..8f87e35bd6a10 100644 --- a/code/controllers/evacuation/evacuation_shuttle.dm +++ b/code/controllers/evacuation/evacuation_shuttle.dm @@ -78,7 +78,7 @@ return ..() // This is largely handled by the emergency shuttle datum. -/datum/evacuation_controller/shuttle/process() +/datum/evacuation_controller/shuttle/Process() if(state == EVAC_PREPPING) if(!isnull(shuttle_launch_time) && world.time > shuttle_launch_time && shuttle.moving_status == SHUTTLE_IDLE) shuttle.launch() diff --git a/code/controllers/master_controller.dm b/code/controllers/master_controller.dm index 1b680b516d850..845df6ace2ece 100644 --- a/code/controllers/master_controller.dm +++ b/code/controllers/master_controller.dm @@ -1,5 +1,5 @@ //simplified MC that is designed to fail when procs 'break'. When it fails it's just replaced with a new one. -//It ensures master_controller.process() is never doubled up by killing the MC (hence terminating any of its sleeping procs) +//It ensures master_controller.Process() is never doubled up by killing the MC (hence terminating any of its sleeping procs) //WIP, needs lots of work still var/global/datum/controller/game_controller/master_controller //Set in world.New() @@ -72,11 +72,11 @@ datum/controller/game_controller/proc/setup_objects() CHECK_SLEEP_MASTER report_progress("Initializing atmos machinery") - for(var/obj/machinery/atmospherics/A in GLOB.machines) + for(var/obj/machinery/atmospherics/A in SSmachines.machinery) A.atmos_init() CHECK_SLEEP_MASTER - for(var/obj/machinery/atmospherics/unary/U in GLOB.machines) + for(var/obj/machinery/atmospherics/unary/U in SSmachines.machinery) if(istype(U, /obj/machinery/atmospherics/unary/vent_pump)) var/obj/machinery/atmospherics/unary/vent_pump/T = U T.broadcast_status() @@ -86,7 +86,7 @@ datum/controller/game_controller/proc/setup_objects() CHECK_SLEEP_MASTER report_progress("Initializing pipe networks") - for(var/obj/machinery/atmospherics/machine in GLOB.machines) + for(var/obj/machinery/atmospherics/machine in SSmachines.machinery) machine.build_network() CHECK_SLEEP_MASTER diff --git a/code/controllers/shuttle_controller.dm b/code/controllers/shuttle_controller.dm index 007ab121a3cab..8202c78531b9c 100644 --- a/code/controllers/shuttle_controller.dm +++ b/code/controllers/shuttle_controller.dm @@ -6,11 +6,11 @@ var/global/datum/shuttle_controller/shuttle_controller var/list/shuttles //maps shuttle tags to shuttle datums, so that they can be looked up. var/list/process_shuttles //simple list of shuttles, for processing -/datum/shuttle_controller/proc/process() +/datum/shuttle_controller/Process() //process ferry shuttles for (var/datum/shuttle/autodock/shuttle in process_shuttles) if (shuttle.process_state) - shuttle.process() + shuttle.Process() //This is called by gameticker after all the machines and radio frequencies have been properly initialized /datum/shuttle_controller/proc/initialize_shuttles() diff --git a/code/controllers/subsystems/event.dm b/code/controllers/subsystems/event.dm index 4eb01b7be8ad6..c225d886d18e6 100644 --- a/code/controllers/subsystems/event.dm +++ b/code/controllers/subsystems/event.dm @@ -51,14 +51,14 @@ SUBSYSTEM_DEF(event) var/datum/event/E = processing_events[processing_events.len] processing_events.len-- - E.process() + E.Process() if (MC_TICK_CHECK) return while (pos <= EVENT_LEVEL_MAJOR) var/list/datum/event_container/EC = event_containers[pos] - EC.process() + EC.Process() pos++ if (MC_TICK_CHECK) diff --git a/code/controllers/voting.dm b/code/controllers/voting.dm index 134b50b8b04dc..45027975d6544 100644 --- a/code/controllers/voting.dm +++ b/code/controllers/voting.dm @@ -82,9 +82,9 @@ SUBSYSTEM_DEF(vote) else return (ticker.mode.addantag_allowed & ADDANTAG_PLAYER) && !antag_add_finished -/datum/controller/subsystem/vote/proc/process() +/datum/controller/subsystem/vote/Process() for(var/datum/vote/curvote in active_votes) - curvote.process() + curvote.Process() /datum/controller/subsystem/vote/proc/vote_start(var/datum/vote/curvote) inactive_votes -= curvote diff --git a/code/controllers/voting/initiate_vote.dm b/code/controllers/voting/initiate_vote.dm index c9c63309e7f4e..3080f3a126910 100644 --- a/code/controllers/voting/initiate_vote.dm +++ b/code/controllers/voting/initiate_vote.dm @@ -35,7 +35,7 @@ time_remaining = round(config.vote_period) - GLOB.processing_objects.Add(src) + START_PROCESSING(SSobj, src) last_process = world.time active = 1 diff --git a/code/controllers/voting/process.dm b/code/controllers/voting/process.dm index 19fd9d0e01e17..6dda696905e3a 100644 --- a/code/controllers/voting/process.dm +++ b/code/controllers/voting/process.dm @@ -1,5 +1,5 @@ -/datum/vote/proc/process() +/datum/vote/Process() // Calculate how much time is remaining by comparing current time, to time of vote start, // plus vote duration if(!delayed) @@ -11,7 +11,7 @@ /datum/vote/proc/end_vote(var/end_early = 0) active = 0 - GLOB.processing_objects.Remove(src) + STOP_PROCESSING(SSobj, src) vote.vote_finish(src) diff --git a/code/controllers/voting/vote_types.dm b/code/controllers/voting/vote_types.dm index 872e5eb991e8d..4860e5e969ccd 100644 --- a/code/controllers/voting/vote_types.dm +++ b/code/controllers/voting/vote_types.dm @@ -91,7 +91,7 @@ if(ticker.current_state <= GAME_STATE_SETTING_UP) pregame_vote = 1 -/datum/vote/gamemode/process() +/datum/vote/gamemode/Process() . = ..() // No more change mode votes after the game has started. diff --git a/code/datums/ai/ai.dm b/code/datums/ai/ai.dm index 13985849ac62f..736c9e7cd8586 100644 --- a/code/datums/ai/ai.dm +++ b/code/datums/ai/ai.dm @@ -1,5 +1,5 @@ /datum/ai var/name -/datum/ai/proc/process() +/datum/ai/Process() return PROCESS_KILL diff --git a/code/datums/chatmessage.dm b/code/datums/chatmessage.dm index 67c3e295ec648..92f723d11def0 100644 --- a/code/datums/chatmessage.dm +++ b/code/datums/chatmessage.dm @@ -162,12 +162,12 @@ // Prepare for destruction scheduled_destruction = world.time + (lifespan - CHAT_MESSAGE_EOL_FADE) - GLOB.processing_objects += src + START_PROCESSING(SSobj, src) //I wish we didn't have to do this, but we don't have a timer subsystem. More load for processing. -/datum/chatmessage/proc/process() +/datum/chatmessage/Process() if(world.time >= scheduled_destruction) - GLOB.processing_objects -= src + STOP_PROCESSING(SSobj, src) end_of_life() return PROCESS_KILL diff --git a/code/datums/datacore.dm b/code/datums/datacore.dm index 4d03ba68a6282..6d1f5d6abf8a8 100644 --- a/code/datums/datacore.dm +++ b/code/datums/datacore.dm @@ -105,10 +105,10 @@ misc[name] = rank // Synthetics don't have actual records, so we will pull them from here. - for(var/mob/living/silicon/ai/ai in GLOB.mob_list) + for(var/mob/living/silicon/ai/ai in SSmobs.mob_list) bot[ai.name] = "Artificial Intelligence" - for(var/mob/living/silicon/robot/robot in GLOB.mob_list) + for(var/mob/living/silicon/robot/robot in SSmobs.mob_list) // No combat/syndicate cyborgs, no drones. if(robot.module && robot.module.hide_on_manifest) continue diff --git a/code/datums/datum.dm b/code/datums/datum.dm index db0f2f71eb96a..4c19c67db496d 100644 --- a/code/datums/datum.dm +++ b/code/datums/datum.dm @@ -12,9 +12,9 @@ // Return the appropriate QDEL_HINT; in most cases this is QDEL_HINT_QUEUE. /datum/proc/Destroy(force=FALSE) tag = null - GLOB.nanomanager && GLOB.nanomanager.close_uis(src) + SSnano && SSnano.close_uis(src) return QDEL_HINT_QUEUE /datum/proc/Process() set waitfor = 0 - return PROCESS_KILL \ No newline at end of file + return PROCESS_KILL diff --git a/code/datums/helper_datums/global_iterator.dm b/code/datums/helper_datums/global_iterator.dm index dc247ea47e718..461564354aefc 100644 --- a/code/datums/helper_datums/global_iterator.dm +++ b/code/datums/helper_datums/global_iterator.dm @@ -73,7 +73,7 @@ Data storage vars: if(check_for_null && has_null_args()) stop() return 0 - result = process(arglist(arg_list)) + result = Process(arglist(arg_list)) for(var/sleep_time=delay;sleep_time>0;sleep_time--) //uhh, this is ugly. But I see no other way to terminate sleeping proc. Such disgrace. if(!control_switch) return 0 @@ -109,7 +109,7 @@ Data storage vars: CRASH("The global_iterator loop \ref[src] failed to terminate in designated timeframe. This may be caused by server lagging.") return 1 - proc/process() + Process() return proc/active() diff --git a/code/datums/repositories/crew/crew.dm b/code/datums/repositories/crew/crew.dm index 8c4843cee29df..b87f2332ff148 100644 --- a/code/datums/repositories/crew/crew.dm +++ b/code/datums/repositories/crew/crew.dm @@ -112,7 +112,7 @@ var/global/datum/repository/crew/crew_repository = new() /datum/repository/crew/proc/scan() var/list/tracked = list() . = tracked - //for(var/mob/living/carbon/human/H in GLOB.mob_list) + //for(var/mob/living/carbon/human/H in SSmobs.mob_list) for(var/datum/mind/M in my_faction.assigned_minds) var/mob/living/carbon/human/H = M.current if(M.current.faction != my_faction.name) diff --git a/code/game/antagonist/alien/borer.dm b/code/game/antagonist/alien/borer.dm index 0afa15ea4543c..75b275f50183a 100644 --- a/code/game/antagonist/alien/borer.dm +++ b/code/game/antagonist/alien/borer.dm @@ -35,7 +35,7 @@ var/datum/antagonist/xenos/borer/borers var/mob/living/simple_animal/borer/borer = mob if(istype(borer)) var/mob/living/carbon/human/host - for(var/mob/living/carbon/human/H in GLOB.mob_list) + for(var/mob/living/carbon/human/H in SSmobs.mob_list) if(H.stat != DEAD && !H.has_brain_worms()) var/obj/item/organ/external/head = H.get_organ(BP_HEAD) if(head && !(head.robotic >= ORGAN_ROBOT)) diff --git a/code/game/antagonist/alien/xenomorph.dm b/code/game/antagonist/alien/xenomorph.dm index 3a06bebeb6344..0fad02d443222 100644 --- a/code/game/antagonist/alien/xenomorph.dm +++ b/code/game/antagonist/alien/xenomorph.dm @@ -36,7 +36,7 @@ var/datum/antagonist/xenos/xenomorphs /datum/antagonist/xenos/proc/get_vents() var/list/vents = list() - for(var/obj/machinery/atmospherics/unary/vent_pump/temp_vent in GLOB.machines) + for(var/obj/machinery/atmospherics/unary/vent_pump/temp_vent in SSmachines.machinery) if(!temp_vent.welded && temp_vent.network && (temp_vent.loc.z in GLOB.using_map.station_levels)) if(temp_vent.network.normal_members.len > 50) vents += temp_vent diff --git a/code/game/antagonist/station/cultist.dm b/code/game/antagonist/station/cultist.dm index 13c05bce02344..40455534f73af 100644 --- a/code/game/antagonist/station/cultist.dm +++ b/code/game/antagonist/station/cultist.dm @@ -154,7 +154,7 @@ var/datum/antagonist/cultist/cult add_cult_magic(H.current) if((CULT_GHOSTS_1 in to_update) || (CULT_GHOSTS_2 in to_update) || (CULT_GHOSTS_3 in to_update)) - for(var/mob/observer/ghost/D in GLOB.mob_list) + for(var/mob/observer/ghost/D in SSmobs.mob_list) add_ghost_magic(D) /datum/antagonist/cultist/proc/offer_uncult(var/mob/M) diff --git a/code/game/antagonist/station/loyalist.dm b/code/game/antagonist/station/loyalist.dm index 742f8045971a2..93e3a9c18d8dd 100644 --- a/code/game/antagonist/station/loyalist.dm +++ b/code/game/antagonist/station/loyalist.dm @@ -39,7 +39,7 @@ var/datum/antagonist/loyalists/loyalists if(!..()) return global_objectives = list() - for(var/mob/living/carbon/human/player in GLOB.mob_list) + for(var/mob/living/carbon/human/player in SSmobs.mob_list) if(!player.mind || player.stat==2 || !(player.mind.assigned_role in command_positions)) continue var/datum/objective/protect/loyal_obj = new diff --git a/code/game/antagonist/station/revolutionary.dm b/code/game/antagonist/station/revolutionary.dm index 1a287a2a622d8..b2bd37e20fa7c 100644 --- a/code/game/antagonist/station/revolutionary.dm +++ b/code/game/antagonist/station/revolutionary.dm @@ -41,7 +41,7 @@ var/datum/antagonist/revolutionary/revs if(!..()) return global_objectives = list() - for(var/mob/living/carbon/human/player in GLOB.mob_list) + for(var/mob/living/carbon/human/player in SSmobs.mob_list) if(!player.mind || player.stat==2 || !(player.mind.assigned_role in command_positions)) continue var/datum/objective/rev/rev_obj = new diff --git a/code/game/area/Space Station 13 areas.dm b/code/game/area/Space Station 13 areas.dm index d7d7e4dfe6d29..d20621634b5e8 100755 --- a/code/game/area/Space Station 13 areas.dm +++ b/code/game/area/Space Station 13 areas.dm @@ -209,7 +209,7 @@ area/space/atmosalert() S.volume = 100 S.priority = 255 S.status = SOUND_UPDATE - process() + Process() /area/beach/Entered(atom/movable/Obj,atom/OldLoc) if(ismob(Obj)) @@ -226,7 +226,7 @@ area/space/atmosalert() mysound.status = SOUND_PAUSED | SOUND_UPDATE sound_to(M, mysound) -/area/beach/proc/process() +/area/beach/Process() set background = 1 var/sound/S = null diff --git a/code/game/gamemodes/cult/hell_universe.dm b/code/game/gamemodes/cult/hell_universe.dm index 63bb7c68c29ab..f73dd9b414a52 100644 --- a/code/game/gamemodes/cult/hell_universe.dm +++ b/code/game/gamemodes/cult/hell_universe.dm @@ -36,6 +36,6 @@ In short: new /obj/effect/gateway/active/cult(T) /datum/universal_state/hell/proc/KillMobs() - for(var/mob/living/simple_animal/M in GLOB.mob_list) + for(var/mob/living/simple_animal/M in SSmobs.mob_list) if(M && !M.client) M.set_stat(DEAD) diff --git a/code/game/gamemodes/cult/narsie.dm b/code/game/gamemodes/cult/narsie.dm index cea0e3ede08fe..4085259385b5a 100644 --- a/code/game/gamemodes/cult/narsie.dm +++ b/code/game/gamemodes/cult/narsie.dm @@ -58,7 +58,7 @@ var/global/list/narsie_list = list() evacuation_controller.call_evacuation(null, TRUE, 1) evacuation_controller.evac_no_return = 0 // Cannot recall -/obj/singularity/narsie/process() +/obj/singularity/narsie/Process() eat() if (!target || prob(5)) @@ -331,7 +331,7 @@ var/global/list/narsie_list = list() chained = 1 move_self = 0 icon_state ="narsie-chains" - for(var/mob/M in GLOB.mob_list)//removing the client image of nar-sie while it is chained + for(var/mob/M in SSmobs.mob_list)//removing the client image of nar-sie while it is chained if(M.client) M.see_narsie(src) diff --git a/code/game/gamemodes/endgame/bluespace_jump/bluespace_jump.dm b/code/game/gamemodes/endgame/bluespace_jump/bluespace_jump.dm index 32f14d43f24cb..0051b90582468 100644 --- a/code/game/gamemodes/endgame/bluespace_jump/bluespace_jump.dm +++ b/code/game/gamemodes/endgame/bluespace_jump/bluespace_jump.dm @@ -10,7 +10,7 @@ /datum/universal_state/bluespace_jump/OnEnter() var/space_zlevel = GLOB.using_map.get_empty_zlevel() //get a place for stragglers - for(var/mob/living/M in GLOB.mob_list) + for(var/mob/living/M in SSmobs.mob_list) if(M.z in affected_levels) var/area/A = get_area(M) if(istype(A,/area/space)) //straggler diff --git a/code/game/gamemodes/endgame/nuclear_explosion/nuclear_explosion.dm b/code/game/gamemodes/endgame/nuclear_explosion/nuclear_explosion.dm index b2a7d515f7871..67390a7f350e2 100644 --- a/code/game/gamemodes/endgame/nuclear_explosion/nuclear_explosion.dm +++ b/code/game/gamemodes/endgame/nuclear_explosion/nuclear_explosion.dm @@ -52,7 +52,7 @@ ticker.mode.explosion_in_progress = 0 /datum/universal_state/nuclear_explosion/proc/dust_mobs(var/list/affected_z_levels) - for(var/mob/living/L in GLOB.mob_list) + for(var/mob/living/L in SSmobs.mob_list) var/turf/T = get_turf(L) if(T && (T.z in affected_z_levels)) //this is needed because dusting resets client screen 1.5 seconds after being called (delayed due to the dusting animation) diff --git a/code/game/gamemodes/endgame/supermatter_cascade/blob.dm b/code/game/gamemodes/endgame/supermatter_cascade/blob.dm index 9fe9a22c7a507..2e35659f089d6 100644 --- a/code/game/gamemodes/endgame/supermatter_cascade/blob.dm +++ b/code/game/gamemodes/endgame/supermatter_cascade/blob.dm @@ -27,7 +27,7 @@ processing_turfs.Remove(src) ..() -/turf/unsimulated/wall/supermatter/process() +/turf/unsimulated/wall/supermatter/Process() // Only check infrequently. if(next_check>world.time) return diff --git a/code/game/gamemodes/endgame/supermatter_cascade/universe.dm b/code/game/gamemodes/endgame/supermatter_cascade/universe.dm index bfd080c523b62..7d9e877764ea8 100644 --- a/code/game/gamemodes/endgame/supermatter_cascade/universe.dm +++ b/code/game/gamemodes/endgame/supermatter_cascade/universe.dm @@ -71,7 +71,7 @@ The access requirements on the Asteroid Shuttles' consoles have now been revoked "} priority_announcement.Announce(txt,"SUPERMATTER CASCADE DETECTED") - for(var/obj/machinery/computer/shuttle_control/C in GLOB.machines) + for(var/obj/machinery/computer/shuttle_control/C in SSmachines.machinery) if(istype(C, /obj/machinery/computer/shuttle_control/research) || istype(C, /obj/machinery/computer/shuttle_control/mining)) C.req_access = list() C.req_one_access = list() @@ -100,12 +100,12 @@ The access requirements on the Asteroid Shuttles' consoles have now been revoked OnTurfChange(T) /datum/universal_state/supermatter_cascade/proc/MiscSet() - for (var/obj/machinery/firealarm/alm in GLOB.machines) + for (var/obj/machinery/firealarm/alm in SSmachines.machinery) if (!(alm.stat & BROKEN)) alm.ex_act(2) /datum/universal_state/supermatter_cascade/proc/APCSet() - for (var/obj/machinery/power/apc/APC in GLOB.machines) + for (var/obj/machinery/power/apc/APC in SSmachines.machinery) if (!(APC.stat & BROKEN) && !APC.is_critical) APC.chargemode = 0 if(APC.cell) diff --git a/code/game/gamemodes/events.dm b/code/game/gamemodes/events.dm index cc2ead9f80213..bc6e139985319 100644 --- a/code/game/gamemodes/events.dm +++ b/code/game/gamemodes/events.dm @@ -41,7 +41,7 @@ var/hadevent = 0 // sound_to(world, sound('sound/AI/aliens.ogg')) var/list/vents = list() - for(var/obj/machinery/atmospherics/unary/vent_pump/temp_vent in GLOB.machines) + for(var/obj/machinery/atmospherics/unary/vent_pump/temp_vent in SSmachines.machinery) if(!temp_vent.welded && temp_vent.network && temp_vent.loc.z in GLOB.using_map.station_levels) if(temp_vent.network.normal_members.len > 50) // Stops Aliens getting stuck in small networks. See: Security, Virology vents += temp_vent @@ -167,7 +167,7 @@ var/hadevent = 0 apc.overload_lighting() else - for(var/obj/machinery/power/apc/apc in GLOB.machines) + for(var/obj/machinery/power/apc/apc in SSmachines.machinery) apc.overload_lighting() return @@ -278,7 +278,7 @@ Would like to add a law like "Law x is _______" where x = a number, and _____ is M.add_ion_law("THE [uppertext(station_name())] IS [who2pref] [who2]") if(botEmagChance) - for(var/mob/living/bot/bot in GLOB.machines) + for(var/mob/living/bot/bot in SSmachines.machinery) if(prob(botEmagChance)) bot.emag_act(1) diff --git a/code/game/gamemodes/events/power_failure.dm b/code/game/gamemodes/events/power_failure.dm index 3d39421687fb4..4869b49a9836a 100644 --- a/code/game/gamemodes/events/power_failure.dm +++ b/code/game/gamemodes/events/power_failure.dm @@ -2,22 +2,22 @@ if(announce) GLOB.using_map.grid_check_announcement() - for(var/obj/machinery/power/smes/buildable/S in GLOB.machines) + for(var/obj/machinery/power/smes/buildable/S in SSmachines.machinery) S.energy_fail(rand(15 * severity,30 * severity)) - for(var/obj/machinery/power/apc/C in GLOB.machines) + for(var/obj/machinery/power/apc/C in SSmachines.machinery) if(!C.is_critical && (!affected_z_levels || (C.z in affected_z_levels))) C.energy_fail(rand(30 * severity,60 * severity)) /proc/power_restore(var/announce = 1) if(announce) GLOB.using_map.grid_restored_announcement() - for(var/obj/machinery/power/apc/C in GLOB.machines) + for(var/obj/machinery/power/apc/C in SSmachines.machinery) C.failure_timer = 0 if(C.cell) C.cell.charge = C.cell.maxcharge - for(var/obj/machinery/power/smes/S in GLOB.machines) + for(var/obj/machinery/power/smes/S in SSmachines.machinery) S.failure_timer = 0 S.charge = S.capacity S.update_icon() @@ -27,7 +27,7 @@ if(announce) command_announcement.Announce("All SMESs on the [station_name()] have been recharged. We apologize for the inconvenience.", "Power Systems Nominal", new_sound = GLOB.using_map.grid_restored_sound) - for(var/obj/machinery/power/smes/S in GLOB.machines) + for(var/obj/machinery/power/smes/S in SSmachines.machinery) S.failure_timer = 0 S.charge = S.capacity S.output_level = S.output_level_max diff --git a/code/game/gamemodes/game_mode.dm b/code/game/gamemodes/game_mode.dm index cd3cda3c25a1f..15685b1c38018 100644 --- a/code/game/gamemodes/game_mode.dm +++ b/code/game/gamemodes/game_mode.dm @@ -501,7 +501,7 @@ var/global/list/additional_antag_types = list() ////////////////////////// proc/display_roundstart_logout_report() var/msg = "Roundstart logout report\n\n" - for(var/mob/living/L in GLOB.mob_list) + for(var/mob/living/L in SSmobs.mob_list) if(L.ckey) var/found = 0 @@ -525,7 +525,7 @@ proc/display_roundstart_logout_report() continue //Dead continue //Happy connected client - for(var/mob/observer/ghost/D in GLOB.mob_list) + for(var/mob/observer/ghost/D in SSmobs.mob_list) if(D.mind && (D.mind.original == L || D.mind.current == L)) if(L.stat == DEAD) msg += "[L.name] ([ckey(D.mind.key)]), the [L.job] (Dead)\n" @@ -540,7 +540,7 @@ proc/display_roundstart_logout_report() msg += "" // close the span from right at the top - for(var/mob/M in GLOB.mob_list) + for(var/mob/M in SSmobs.mob_list) if(M.client && M.client.holder) to_chat(M, msg) proc/get_nt_opposed() diff --git a/code/game/gamemodes/game_mode_latespawn.dm b/code/game/gamemodes/game_mode_latespawn.dm index 290fb2314fae3..6c0063865e665 100644 --- a/code/game/gamemodes/game_mode_latespawn.dm +++ b/code/game/gamemodes/game_mode_latespawn.dm @@ -3,9 +3,9 @@ /datum/game_mode/var/max_autotraitor_delay = 12 MINUTES /datum/game_mode/var/process_count = 0 -///process() +///Process() ///Called by the gameticker -/datum/game_mode/proc/process() +/datum/game_mode/Process() if(shall_process_autoantag()) process_autoantag() diff --git a/code/game/gamemodes/gameticker.dm b/code/game/gamemodes/gameticker.dm index 7ef6f28e69e75..0220e049a5f46 100644 --- a/code/game/gamemodes/gameticker.dm +++ b/code/game/gamemodes/gameticker.dm @@ -57,7 +57,7 @@ var/global/datum/controller/gameticker/ticker while(current_state == GAME_STATE_PREGAME) for(var/i=0, i<10, i++) sleep(1) - vote.process() + vote.Process() if(round_progressing) pregame_timeleft-- if(pregame_timeleft <= config.vote_autogamemode_timeleft && !gamemode_voted) @@ -70,7 +70,7 @@ var/global/datum/controller/gameticker/ticker while(vote.delay_round_start()) for(var/i=0, i<10, i++) sleep(1) - vote.process() + vote.Process() if(pregame_timeleft <= 0 || ((initialization_stage & INITIALIZATION_NOW_AND_COMPLETE) == INITIALIZATION_NOW_AND_COMPLETE)) current_state = GAME_STATE_SETTING_UP Master.SetRunLevel(RUNLEVEL_SETUP) @@ -337,13 +337,13 @@ var/global/datum/controller/gameticker/ticker to_chat(M, "Captainship not forced on anyone.") - proc/process() + Process() if(current_state != GAME_STATE_PLAYING) return 0 - mode.process() + mode.Process() -// emergency_shuttle.process() //handled in scheduler +// emergency_shuttle.Process() //handled in scheduler var/game_finished = 0 var/mode_finished = 0 @@ -459,7 +459,7 @@ var/global/datum/controller/gameticker/ticker /* - for (var/mob/living/silicon/ai/aiPlayer in GLOB.mob_list) + for (var/mob/living/silicon/ai/aiPlayer in SSmobs.mob_list) if (aiPlayer.stat != 2) to_world("[aiPlayer.name] (Played by: [aiPlayer.key])'s laws at the end of the round were:") @@ -479,7 +479,7 @@ var/global/datum/controller/gameticker/ticker /* var/dronecount = 0 - for (var/mob/living/silicon/robot/robo in GLOB.mob_list) + for (var/mob/living/silicon/robot/robo in SSmobs.mob_list) if(istype(robo,/mob/living/silicon/robot/drone)) dronecount++ diff --git a/code/game/gamemodes/malfunction/malf_research.dm b/code/game/gamemodes/malfunction/malf_research.dm index 3c3b7773edf36..06aa74e8a6daf 100644 --- a/code/game/gamemodes/malfunction/malf_research.dm +++ b/code/game/gamemodes/malfunction/malf_research.dm @@ -44,7 +44,7 @@ // Proc: process() // Parameters: None // Description: Processes CPU gain and research progress based on "realtime" calculation. -/datum/malf_research/proc/process(var/idle = 0) +/datum/malf_research/Process(var/idle = 0) if(idle) // No power or running on APU. Do nothing. last_tick = world.time return @@ -60,7 +60,7 @@ cpu_gained = max(0, cpu_gained) if(focus && (cpu_gained > 0)) - focus.process(cpu_gained) + focus.Process(cpu_gained) if(focus.unlocked) finish_research() diff --git a/code/game/gamemodes/malfunction/malf_research_ability.dm b/code/game/gamemodes/malfunction/malf_research_ability.dm index addaee69ae37a..e415c5711db29 100644 --- a/code/game/gamemodes/malfunction/malf_research_ability.dm +++ b/code/game/gamemodes/malfunction/malf_research_ability.dm @@ -7,7 +7,7 @@ var/datum/malf_research_ability/next = null // Next research (if applicable). -/datum/malf_research_ability/proc/process(var/time = 0) +/datum/malf_research_ability/Process(var/time = 0) invested += time if(invested >= price) unlocked = 1 diff --git a/code/game/gamemodes/malfunction/newmalf_ability_trees/HELPERS.dm b/code/game/gamemodes/malfunction/newmalf_ability_trees/HELPERS.dm index ea6ec4bb869ce..96c38afa364a4 100644 --- a/code/game/gamemodes/malfunction/newmalf_ability_trees/HELPERS.dm +++ b/code/game/gamemodes/malfunction/newmalf_ability_trees/HELPERS.dm @@ -172,7 +172,7 @@ var/list/station_apcs = list() var/list/offstation_apcs = list() - for(var/obj/machinery/power/apc/A in GLOB.machines) + for(var/obj/machinery/power/apc/A in SSmachines.machinery) if(A.hacker && A.hacker == user) continue if(A.z in GLOB.using_map.station_levels) @@ -191,7 +191,7 @@ return var/list/L = list() - for(var/mob/living/silicon/robot/RB in GLOB.mob_list) + for(var/mob/living/silicon/robot/RB in SSmobs.mob_list) if(istype(RB, /mob/living/silicon/robot/drone)) continue if(RB.connected_ai == A) @@ -209,7 +209,7 @@ return var/list/L = list() - for(var/mob/living/silicon/ai/AT in GLOB.mob_list) + for(var/mob/living/silicon/ai/AT in SSmobs.mob_list) if(L == A) continue L.Add(AT) @@ -224,6 +224,6 @@ admin_attack_log(A, null, message, null, message) proc/check_for_interception() - for(var/mob/living/silicon/ai/A in GLOB.mob_list) + for(var/mob/living/silicon/ai/A in SSmobs.mob_list) if(A.intercepts_communication) return A \ No newline at end of file diff --git a/code/game/gamemodes/malfunction/newmalf_ability_trees/tree_manipulation.dm b/code/game/gamemodes/malfunction/newmalf_ability_trees/tree_manipulation.dm index 6aa170ca18296..a5ee922eaa8dc 100644 --- a/code/game/gamemodes/malfunction/newmalf_ability_trees/tree_manipulation.dm +++ b/code/game/gamemodes/malfunction/newmalf_ability_trees/tree_manipulation.dm @@ -54,7 +54,7 @@ if(!ability_prechecks(user, price) || !ability_pay(user,price)) return to_chat(user, "Sending feedback pulse...") - for(var/obj/machinery/power/apc/AP in GLOB.machines) + for(var/obj/machinery/power/apc/AP in SSmachines.machinery) if(prob(5)) AP.overload_lighting() if(prob(2.5) && (get_area(AP) != get_area(user))) // Very very small chance to actually destroy the APC, but not if the APC is powering the AI. @@ -108,7 +108,7 @@ user.hacking = 0 -/datum/game_mode/malfunction/verb/machine_overload(obj/machinery/M in GLOB.machines) +/datum/game_mode/malfunction/verb/machine_overload(obj/machinery/M in SSmachines.machinery) set name = "Machine Overload" set desc = "400 CPU - Causes cyclic short-circuit in machine, resulting in weak explosion after some time." set category = "Software" @@ -181,7 +181,7 @@ if(M) qdel(M) -/datum/game_mode/malfunction/verb/machine_upgrade(obj/machinery/M in GLOB.machines) +/datum/game_mode/malfunction/verb/machine_upgrade(obj/machinery/M in SSmachines.machinery) set name = "Machine Upgrade" set desc = "800 CPU - Pushes existing hardware to it's technological limits by rapidly upgrading it's software." set category = "Software" diff --git a/code/game/gamemodes/malfunction/newmalf_ability_trees/tree_networking.dm b/code/game/gamemodes/malfunction/newmalf_ability_trees/tree_networking.dm index 3184ed21af409..0636319504529 100644 --- a/code/game/gamemodes/malfunction/newmalf_ability_trees/tree_networking.dm +++ b/code/game/gamemodes/malfunction/newmalf_ability_trees/tree_networking.dm @@ -155,7 +155,7 @@ return log_ability_use(user, "system override (STARTED)") var/list/remaining_apcs = list() - for(var/obj/machinery/power/apc/A in GLOB.machines) + for(var/obj/machinery/power/apc/A in SSmachines.machinery) if(!(A.z in GLOB.using_map.station_levels)) // Only station APCs continue if(A.hacker == user || A.aidisabled) // This one is already hacked, or AI control is disabled on it. @@ -200,7 +200,7 @@ to_chat(user, "## REACHABLE APC SYSTEMS OVERTAKEN. BYPASSING PRIMARY FIREWALL.") sleep(1 MINUTE) // Hack all APCs, including those built during hack sequence. - for(var/obj/machinery/power/apc/A in GLOB.machines) + for(var/obj/machinery/power/apc/A in SSmachines.machinery) if((!A.hacker || A.hacker != src) && !A.aidisabled && A.z in GLOB.using_map.station_levels) A.ai_hack(src) diff --git a/code/game/gamemodes/meteor/meteor.dm b/code/game/gamemodes/meteor/meteor.dm index 75d1edaeb3d92..1e6872f6709f1 100644 --- a/code/game/gamemodes/meteor/meteor.dm +++ b/code/game/gamemodes/meteor/meteor.dm @@ -35,7 +35,7 @@ start_text = "This is an automatic warning. Your facility: [GLOB.using_map.full_name] has entered an asteroid belt. Estimated time until you leave the belt is: [rand(20,30)] HOURS and [rand(1, 59)] MINUTES. For your safety, please consider changing course or using protective equipment. Have a nice day." next_wave = round_duration_in_ticks + METEOR_DELAY -/datum/game_mode/meteor/process() +/datum/game_mode/meteor/Process() // Send an alert halfway through the round. if((round_duration_in_ticks >= (next_wave / 2)) && !alert_sent) alert_sent = 1 @@ -44,7 +44,7 @@ if((round_duration_in_ticks >= next_wave) && (alert_sent == 1)) alert_sent = 2 command_announcement.Announce(start_text, alert_title) - for(var/obj/machinery/shield_diffuser/SD in GLOB.machines) + for(var/obj/machinery/shield_diffuser/SD in SSmachines.machinery) SD.meteor_alarm(INFINITY) next_wave = round_duration_in_ticks + (meteor_wave_delay * time_between_waves_minutes) if((round_duration_in_ticks >= METEOR_FAILSAFE_THRESHOLD) && (meteor_severity < 15) && !failsafe_triggered) diff --git a/code/game/gamemodes/nuclear/pinpointer.dm b/code/game/gamemodes/nuclear/pinpointer.dm index b0bed56e59a34..1d529ea2efe0e 100644 --- a/code/game/gamemodes/nuclear/pinpointer.dm +++ b/code/game/gamemodes/nuclear/pinpointer.dm @@ -172,7 +172,7 @@ var/list/nuke_disks = list() var/DNAstring = input("Input DNA string to search for." , "Please Enter String." , "") if(!DNAstring) return - for(var/mob/living/carbon/M in GLOB.mob_list) + for(var/mob/living/carbon/M in SSmobs.mob_list) if(!M.dna) continue if(M.dna.unique_enzymes == DNAstring) diff --git a/code/game/gamemodes/objective.dm b/code/game/gamemodes/objective.dm index cd7032705d8f7..7c8e687ab7ee8 100644 --- a/code/game/gamemodes/objective.dm +++ b/code/game/gamemodes/objective.dm @@ -539,7 +539,7 @@ datum/objective/heist/salvage explanation_text = "Summon Nar-Sie via the use of the appropriate rune (Hell join self). It will only work if nine cultists stand on and around it. The convert rune is join blood self." /datum/objective/cult/eldergod/check_completion() - return (locate(/obj/singularity/narsie/large) in GLOB.machines) + return (locate(/obj/singularity/narsie/large) in SSmachines.machinery) /datum/objective/cult/sacrifice explanation_text = "Conduct a ritual sacrifice for the glory of Nar-Sie." diff --git a/code/game/machinery/Sleeper.dm b/code/game/machinery/Sleeper.dm index eeb92b5722361..55ceea67922b4 100644 --- a/code/game/machinery/Sleeper.dm +++ b/code/game/machinery/Sleeper.dm @@ -22,7 +22,7 @@ beaker = new /obj/item/weapon/reagent_containers/glass/beaker/large(src) update_icon() -/obj/machinery/sleeper/process() +/obj/machinery/sleeper/Process() if(stat & (NOPOWER|BROKEN)) return diff --git a/code/game/machinery/adv_med.dm b/code/game/machinery/adv_med.dm index 20f3474e3f428..9477903219c09 100644 --- a/code/game/machinery/adv_med.dm +++ b/code/game/machinery/adv_med.dm @@ -194,7 +194,7 @@ /* -/obj/machinery/body_scanconsole/process() //not really used right now +/obj/machinery/body_scanconsole/Process() //not really used right now if(stat & (NOPOWER|BROKEN)) return //use_power(250) // power stuff diff --git a/code/game/machinery/alarm.dm b/code/game/machinery/alarm.dm index 71838478f4305..88e56169387a4 100644 --- a/code/game/machinery/alarm.dm +++ b/code/game/machinery/alarm.dm @@ -141,7 +141,7 @@ if (!master_is_operating()) elect_master() -/obj/machinery/alarm/process() +/obj/machinery/alarm/Process() if((stat & (NOPOWER|BROKEN)) || shorted || buildstage != 2) return @@ -976,7 +976,7 @@ FIRE ALARM src.alarm() return -/obj/machinery/firealarm/process()//Note: this processing was mostly phased out due to other code, and only runs when needed +/obj/machinery/firealarm/Process()//Note: this processing was mostly phased out due to other code, and only runs when needed if(stat & (NOPOWER|BROKEN)) return @@ -987,7 +987,7 @@ FIRE ALARM src.alarm() src.time = 0 src.timing = 0 - GLOB.processing_objects.Remove(src) + STOP_PROCESSING(SSobj, src) src.updateDialog() last_process = world.timeofday @@ -1057,7 +1057,7 @@ FIRE ALARM else if (href_list["time"]) src.timing = text2num(href_list["time"]) last_process = world.timeofday - GLOB.processing_objects.Add(src) + START_PROCESSING(SSobj, src) else if (href_list["tp"]) var/tp = text2num(href_list["tp"]) src.time += tp diff --git a/code/game/machinery/atmo_control.dm b/code/game/machinery/atmo_control.dm index 4678c8757ff47..7a33e5baf8a2f 100644 --- a/code/game/machinery/atmo_control.dm +++ b/code/game/machinery/atmo_control.dm @@ -25,7 +25,7 @@ /obj/machinery/air_sensor/update_icon() icon_state = "gsensor[on]" -/obj/machinery/air_sensor/process() +/obj/machinery/air_sensor/Process() if(on) var/datum/signal/signal = new signal.transmission_method = 1 //radio signal @@ -99,7 +99,7 @@ obj/machinery/computer/general_air_control/Destroy() user.set_machine(src) onclose(user, "computer") -/obj/machinery/computer/general_air_control/process() +/obj/machinery/computer/general_air_control/Process() ..() src.updateUsrDialog() @@ -409,7 +409,7 @@ Min Core Pressure: [pressure_limit] kPa
"} var/on_temperature = 1200 circuit = /obj/item/weapon/circuitboard/air_management/injector_control -/obj/machinery/computer/general_air_control/fuel_injection/process() +/obj/machinery/computer/general_air_control/fuel_injection/Process() if(automation) if(!radio_connection) return 0 diff --git a/code/game/machinery/atmoalter/canister.dm b/code/game/machinery/atmoalter/canister.dm index ff253229dc0e3..ef4bc62672d9f 100644 --- a/code/game/machinery/atmoalter/canister.dm +++ b/code/game/machinery/atmoalter/canister.dm @@ -190,7 +190,7 @@ update_flag else return 1 -/obj/machinery/portable_atmospherics/canister/process() +/obj/machinery/portable_atmospherics/canister/Process() if (destroyed) return diff --git a/code/game/machinery/atmoalter/meter.dm b/code/game/machinery/atmoalter/meter.dm index 490d6eeefcc35..ab7ace9c91e09 100644 --- a/code/game/machinery/atmoalter/meter.dm +++ b/code/game/machinery/atmoalter/meter.dm @@ -16,7 +16,7 @@ if (!target) src.target = locate(/obj/machinery/atmospherics/pipe) in loc -/obj/machinery/meter/process() +/obj/machinery/meter/Process() if(!target) icon_state = "meterX" return 0 diff --git a/code/game/machinery/atmoalter/portable_atmospherics.dm b/code/game/machinery/atmoalter/portable_atmospherics.dm index 5e9d0fb68d831..7b04c773f8911 100644 --- a/code/game/machinery/atmoalter/portable_atmospherics.dm +++ b/code/game/machinery/atmoalter/portable_atmospherics.dm @@ -35,7 +35,7 @@ connect(port) update_icon() -/obj/machinery/portable_atmospherics/process() +/obj/machinery/portable_atmospherics/Process() if(!connected_port) //only react when pipe_network will ont it do it for you //Allow for reactions air_contents.react() diff --git a/code/game/machinery/atmoalter/pump.dm b/code/game/machinery/atmoalter/pump.dm index 1525c32769991..305dd730607c9 100644 --- a/code/game/machinery/atmoalter/pump.dm +++ b/code/game/machinery/atmoalter/pump.dm @@ -60,7 +60,7 @@ ..(severity) -/obj/machinery/portable_atmospherics/powered/pump/process() +/obj/machinery/portable_atmospherics/powered/pump/Process() ..() var/power_draw = -1 diff --git a/code/game/machinery/atmoalter/scrubber.dm b/code/game/machinery/atmoalter/scrubber.dm index d4e712332e5f1..0f85c66aacf3a 100644 --- a/code/game/machinery/atmoalter/scrubber.dm +++ b/code/game/machinery/atmoalter/scrubber.dm @@ -30,7 +30,7 @@ for(var/g in gas_data.gases) if(g != "oxygen" && g != "nitrogen") scrubbing_gas += g - + /obj/machinery/portable_atmospherics/powered/scrubber/emp_act(severity) if(stat & (BROKEN|NOPOWER)) @@ -59,7 +59,7 @@ return -/obj/machinery/portable_atmospherics/powered/scrubber/process() +/obj/machinery/portable_atmospherics/powered/scrubber/Process() ..() var/power_draw = -1 @@ -188,7 +188,7 @@ if (old_stat != stat) update_icon() -/obj/machinery/portable_atmospherics/powered/scrubber/huge/process() +/obj/machinery/portable_atmospherics/powered/scrubber/huge/Process() if(!on || (stat & (NOPOWER|BROKEN))) update_use_power(0) last_flow_rate = 0 diff --git a/code/game/machinery/atmoalter/zvent.dm b/code/game/machinery/atmoalter/zvent.dm index 7df54a0bb8e64..e7cf942dd343c 100644 --- a/code/game/machinery/atmoalter/zvent.dm +++ b/code/game/machinery/atmoalter/zvent.dm @@ -9,7 +9,7 @@ var/on = 0 var/volume_rate = 800 -/obj/machinery/zvent/process() +/obj/machinery/zvent/Process() //all this object does, is make its turf share air with the ones above and below it, if they have a vent too. if (istype(loc,/turf/simulated)) //if we're not on a valid turf, forget it diff --git a/code/game/machinery/bluespacerelay.dm b/code/game/machinery/bluespacerelay.dm index 4f7ab82207ccc..4814e2d91059e 100644 --- a/code/game/machinery/bluespacerelay.dm +++ b/code/game/machinery/bluespacerelay.dm @@ -12,7 +12,7 @@ idle_power_usage = 15000 active_power_usage = 15000 -/obj/machinery/bluespacerelay/process() +/obj/machinery/bluespacerelay/Process() update_power() diff --git a/code/game/machinery/camera/camera.dm b/code/game/machinery/camera/camera.dm index 24d62d13add5c..70ffc4d6ccf82 100644 --- a/code/game/machinery/camera/camera.dm +++ b/code/game/machinery/camera/camera.dm @@ -99,7 +99,7 @@ wires = null return ..() -/obj/machinery/camera/process() +/obj/machinery/camera/Process() if((stat & EMPED) && world.time >= affected_by_emp_until) stat &= ~EMPED cancelCameraAlarm() @@ -120,7 +120,7 @@ triggerCameraAlarm() update_icon() update_coverage() - GLOB.processing_objects |= src + START_PROCESSING(SSobj, src) /obj/machinery/camera/bullet_act(var/obj/item/projectile/P) take_damage(P.get_structure_damage()) diff --git a/code/game/machinery/camera/tracking.dm b/code/game/machinery/camera/tracking.dm index d21bb2f43d9cf..80d90da33872d 100644 --- a/code/game/machinery/camera/tracking.dm +++ b/code/game/machinery/camera/tracking.dm @@ -105,7 +105,7 @@ return list() var/datum/trackable/TB = new() - for(var/mob/living/M in GLOB.mob_list) + for(var/mob/living/M in SSmobs.mob_list) if(M == usr) continue if(M.tracking_status() != TRACKING_POSSIBLE) diff --git a/code/game/machinery/cell_charger.dm b/code/game/machinery/cell_charger.dm index c7f313fee1405..4c08ce5d1d465 100644 --- a/code/game/machinery/cell_charger.dm +++ b/code/game/machinery/cell_charger.dm @@ -99,7 +99,7 @@ ..(severity) -/obj/machinery/cell_charger/process() +/obj/machinery/cell_charger/Process() // log_debug("ccpt [charging] [stat]") if((stat & (BROKEN|NOPOWER)) || !anchored) diff --git a/code/game/machinery/computer/Operating.dm b/code/game/machinery/computer/Operating.dm index cbc604affa55b..ba455b1917367 100644 --- a/code/game/machinery/computer/Operating.dm +++ b/code/game/machinery/computer/Operating.dm @@ -68,6 +68,6 @@ return -/obj/machinery/computer/operating/process() +/obj/machinery/computer/operating/Process() if(..()) src.updateDialog() diff --git a/code/game/machinery/computer/computer.dm b/code/game/machinery/computer/computer.dm index e735b29f0bb82..012947ca464b6 100644 --- a/code/game/machinery/computer/computer.dm +++ b/code/game/machinery/computer/computer.dm @@ -28,7 +28,7 @@ power_change() update_icon() -/obj/machinery/computer/process() +/obj/machinery/computer/Process() if(stat & (NOPOWER|BROKEN)) return 0 return 1 diff --git a/code/game/machinery/computer/pod.dm b/code/game/machinery/computer/pod.dm index 187b3679a4969..9894ce09496ea 100644 --- a/code/game/machinery/computer/pod.dm +++ b/code/game/machinery/computer/pod.dm @@ -143,7 +143,7 @@ return -/obj/machinery/computer/pod/process() +/obj/machinery/computer/pod/Process() if(!..()) return if(timing) @@ -170,7 +170,7 @@ if(href_list["alarm"]) alarm() if(href_list["drive"]) - for(var/obj/machinery/mass_driver/M in GLOB.machines) + for(var/obj/machinery/mass_driver/M in SSmachines.machinery) if(M.id == id) M.power = connected.power M.drive() diff --git a/code/game/machinery/cryo.dm b/code/game/machinery/cryo.dm index 52015ad50edd4..7d026c180de3a 100644 --- a/code/game/machinery/cryo.dm +++ b/code/game/machinery/cryo.dm @@ -46,7 +46,7 @@ node = target break -/obj/machinery/atmospherics/unary/cryo_cell/process() +/obj/machinery/atmospherics/unary/cryo_cell/Process() ..() if(!node) return diff --git a/code/game/machinery/cryopod.dm b/code/game/machinery/cryopod.dm index 6ba673b4dc032..a5680a101f7ef 100644 --- a/code/game/machinery/cryopod.dm +++ b/code/game/machinery/cryopod.dm @@ -252,7 +252,7 @@ return 1 //Lifted from Unity stasis.dm and refactored. ~Zuhayr -/obj/machinery/cryopod/process() +/obj/machinery/cryopod/Process() if(occupant) //Allow a ten minute gap between entering the pod and actually despawning. if(world.time - time_entered < time_till_despawn) diff --git a/code/game/machinery/door_control.dm b/code/game/machinery/door_control.dm index f9a7fe1a1b324..359eebfe4c7f1 100644 --- a/code/game/machinery/door_control.dm +++ b/code/game/machinery/door_control.dm @@ -175,7 +175,7 @@ active = 1 update_icon() - for(var/obj/machinery/door/blast/M in GLOB.machines) + for(var/obj/machinery/door/blast/M in SSmachines.machinery) if (M.id == src.id) spawn( 0 ) M.open() @@ -183,13 +183,13 @@ sleep(20) - for(var/obj/machinery/mass_driver/M in GLOB.machines) + for(var/obj/machinery/mass_driver/M in SSmachines.machinery) if(M.id == src.id) M.drive() sleep(50) - for(var/obj/machinery/door/blast/M in GLOB.machines) + for(var/obj/machinery/door/blast/M in SSmachines.machinery) if (M.id == src.id) spawn(0) M.close() diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm index caa4b3bca6611..d2d02d42cf9e5 100644 --- a/code/game/machinery/doors/airlock.dm +++ b/code/game/machinery/doors/airlock.dm @@ -363,7 +363,7 @@ var/list/airlock_overlays = list() /obj/machinery/door/airlock/vault/bolted locked = 1 -/obj/machinery/door/airlock/process() +/obj/machinery/door/airlock/Process() if(main_power_lost_until > 0 && world.time >= main_power_lost_until) regainMainPower() @@ -375,7 +375,7 @@ var/list/airlock_overlays = list() ..() -/obj/machinery/door/airlock/uranium/process() +/obj/machinery/door/airlock/uranium/Process() if(world.time > last_event+20) if(prob(50)) radiation_repository.radiate(src, rad_power) diff --git a/code/game/machinery/doors/airlock_control.dm b/code/game/machinery/doors/airlock_control.dm index c2d6e0f3c69a6..e4fa6335784b3 100644 --- a/code/game/machinery/doors/airlock_control.dm +++ b/code/game/machinery/doors/airlock_control.dm @@ -8,7 +8,7 @@ obj/machinery/door/airlock var/datum/radio_frequency/radio_connection var/cur_command = null //the command the door is currently attempting to complete -obj/machinery/door/airlock/process() +obj/machinery/door/airlock/Process() ..() if (arePowerSystemsOn()) execute_current_command() @@ -192,7 +192,7 @@ obj/machinery/airlock_sensor/attack_hand(mob/user) radio_connection.post_signal(src, signal, range = AIRLOCK_CONTROL_RANGE, filter = RADIO_AIRLOCK) flick("airlock_sensor_cycle", src) -obj/machinery/airlock_sensor/process() +obj/machinery/airlock_sensor/Process() if(on) var/datum/gas_mixture/air_sample = return_air() var/pressure = round(air_sample.return_pressure(),0.1) diff --git a/code/game/machinery/doors/brigdoors.dm b/code/game/machinery/doors/brigdoors.dm index 51ba7782fe17f..350a97b69c37e 100644 --- a/code/game/machinery/doors/brigdoors.dm +++ b/code/game/machinery/doors/brigdoors.dm @@ -35,11 +35,11 @@ ..() spawn(20) - for(var/obj/machinery/door/window/brigdoor/M in GLOB.machines) + for(var/obj/machinery/door/window/brigdoor/M in SSmachines.machinery) if (M.id == src.id) targets += M - for(var/obj/machinery/flasher/F in GLOB.machines) + for(var/obj/machinery/flasher/F in SSmachines.machinery) if(F.id == src.id) targets += F @@ -57,7 +57,7 @@ //Main door timer loop, if it's timing and time is >0 reduce time by 1. // if it's less than 0, open door, reset timer // update the door_timer window and the icon -/obj/machinery/door_timer/process() +/obj/machinery/door_timer/Process() if(stat & (NOPOWER|BROKEN)) return if(src.timing) diff --git a/code/game/machinery/doors/door.dm b/code/game/machinery/doors/door.dm index ab6a2f0ffbeca..72f6f4396ceeb 100644 --- a/code/game/machinery/doors/door.dm +++ b/code/game/machinery/doors/door.dm @@ -76,7 +76,7 @@ qdel(A) . = ..() -/obj/machinery/door/process() +/obj/machinery/door/Process() if(close_door_at && world.time >= close_door_at) if(autoclose) close_door_at = next_close_time() diff --git a/code/game/machinery/doors/firedoor.dm b/code/game/machinery/doors/firedoor.dm index 23440506ac74d..fb9e5363a0c54 100644 --- a/code/game/machinery/doors/firedoor.dm +++ b/code/game/machinery/doors/firedoor.dm @@ -275,7 +275,7 @@ return FA // CHECK PRESSURE -/obj/machinery/door/firedoor/process() +/obj/machinery/door/firedoor/Process() ..() if(density && next_process_time <= world.time) diff --git a/code/game/machinery/doors/simple.dm b/code/game/machinery/doors/simple.dm index c0a16d34180cc..2664e835d5a5c 100644 --- a/code/game/machinery/doors/simple.dm +++ b/code/game/machinery/doors/simple.dm @@ -9,7 +9,7 @@ var/datum/lock/lock var/initial_lock_value //for mapping purposes. Basically if this value is set, it sets the lock to this value. -/obj/machinery/door/unpowered/simple/process() +/obj/machinery/door/unpowered/simple/Process() return PROCESS_KILL /obj/machinery/door/unpowered/simple/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume) diff --git a/code/game/machinery/embedded_controller/airlock_controllers_dummy.dm b/code/game/machinery/embedded_controller/airlock_controllers_dummy.dm index a81ae5a3a4331..9f912c4775395 100644 --- a/code/game/machinery/embedded_controller/airlock_controllers_dummy.dm +++ b/code/game/machinery/embedded_controller/airlock_controllers_dummy.dm @@ -9,7 +9,7 @@ var/obj/machinery/embedded_controller/radio/airlock/master_controller var/id_tag -/obj/machinery/dummy_airlock_controller/process() +/obj/machinery/dummy_airlock_controller/Process() if(master_controller) appearance = master_controller . = ..() @@ -17,7 +17,7 @@ /obj/machinery/dummy_airlock_controller/Initialize() . = ..() if(id_tag) - for(var/obj/machinery/embedded_controller/radio/airlock/_master in GLOB.machines) + for(var/obj/machinery/embedded_controller/radio/airlock/_master in SSmachines.machinery) if(_master.id_tag == id_tag) master_controller = _master master_controller.dummy_terminals += src diff --git a/code/game/machinery/embedded_controller/airlock_docking_controller.dm b/code/game/machinery/embedded_controller/airlock_docking_controller.dm index 7f29d7c15c590..6738f49cf53e0 100644 --- a/code/game/machinery/embedded_controller/airlock_docking_controller.dm +++ b/code/game/machinery/embedded_controller/airlock_docking_controller.dm @@ -81,8 +81,8 @@ ..(command) airlock_program.receive_user_command(command) //pass along to subprograms -/datum/computer/file/embedded_program/docking/airlock/process() - airlock_program.process() +/datum/computer/file/embedded_program/docking/airlock/Process() + airlock_program.Process() ..() /datum/computer/file/embedded_program/docking/airlock/receive_signal(datum/signal/signal, receive_method, receive_param) diff --git a/code/game/machinery/embedded_controller/airlock_program.dm b/code/game/machinery/embedded_controller/airlock_program.dm index e414c4a70c51d..bed905f7fcf58 100644 --- a/code/game/machinery/embedded_controller/airlock_program.dm +++ b/code/game/machinery/embedded_controller/airlock_program.dm @@ -171,7 +171,7 @@ -/datum/computer/file/embedded_program/airlock/process() +/datum/computer/file/embedded_program/airlock/Process() if(!state) //Idle if(target_state) switch(target_state) diff --git a/code/game/machinery/embedded_controller/docking_program.dm b/code/game/machinery/embedded_controller/docking_program.dm index bbc150409b3a5..c4527e4f84064 100644 --- a/code/game/machinery/embedded_controller/docking_program.dm +++ b/code/game/machinery/embedded_controller/docking_program.dm @@ -12,51 +12,51 @@ /* *** STATE TABLE *** - + MODE_CLIENT|STATE_UNDOCKED sent a request for docking and now waiting for a reply. MODE_CLIENT|STATE_DOCKING server told us they are OK to dock, waiting for our docking port to be ready. MODE_CLIENT|STATE_DOCKED idle - docked as client. MODE_CLIENT|STATE_UNDOCKING we are either waiting for our docking port to be ready or for the server to give us the OK to finish undocking. - + MODE_SERVER|STATE_UNDOCKED should never happen. MODE_SERVER|STATE_DOCKING someone requested docking, we are waiting for our docking port to be ready. MODE_SERVER|STATE_DOCKED idle - docked as server MODE_SERVER|STATE_UNDOCKING client requested undocking, we are waiting for our docking port to be ready. - + MODE_NONE|STATE_UNDOCKED idle - not docked. MODE_NONE|anything else should never happen. - + *** Docking Signals *** - + Docking Client sends request_dock Server sends confirm_dock to say that yes, we will serve your request When client is ready, sends confirm_dock Server sends confirm_dock back to indicate that docking is complete - + Undocking Client sends request_undock When client is ready, sends confirm_undock Server sends confirm_undock back to indicate that docking is complete - + Note that in both cases each side exchanges confirm_dock before the docking operation is considered done. - The client first sends a confirm message to indicate it is ready, and then finally the server will send it's + The client first sends a confirm message to indicate it is ready, and then finally the server will send it's confirm message to indicate that the operation is complete. - + Note also that when docking, the server sends an additional confirm message. This is because before docking, the server and client do not have a defined relationship. Before undocking, the server and client are already related to each other, thus the extra confirm message is not needed. - + *** Override, what is it? *** - + The purpose of enabling the override is to prevent the docking program from automatically doing things with the docking port when docking or undocking. Maybe the shuttle is full of plamsa/phoron for some reason, and you don't want the door to automatically open, or the airlock to cycle. This means that the prepare_for_docking/undocking and finish_docking/undocking procs don't get called. - + The docking controller will still check the state of the docking port, and thus prevent the shuttle from launching unless they force the launch (handling forced - launches is not the docking controller's responsibility). In this case it is up to the players to manually get the docking port into a good state to undock + launches is not the docking controller's responsibility). In this case it is up to the players to manually get the docking port into a good state to undock (which usually just means closing and locking the doors). - + In line with this, docking controllers should prevent players from manually doing things when the override is NOT enabled. */ @@ -67,7 +67,7 @@ var/control_mode = MODE_NONE var/response_sent = 0 //so we don't spam confirmation messages var/resend_counter = 0 //for periodically resending confirmation messages in case they are missed - + var/override_enabled = 0 //when enabled, do not open/close doors or cycle airlocks and wait for the player to do it manually var/received_confirm = 0 //for undocking, whether the server has recieved a confirmation from the client @@ -80,10 +80,10 @@ var/receive_tag = signal.data["tag"] //for docking signals, this is the sender id var/command = signal.data["command"] var/recipient = signal.data["recipient"] //the intended recipient of the docking signal - + if (recipient != id_tag) return //this signal is not for us - + switch (command) if ("confirm_dock") if (control_mode == MODE_CLIENT && dock_state == STATE_UNDOCKED && receive_tag == tag_target) @@ -91,7 +91,7 @@ broadcast_docking_status() if (!override_enabled) prepare_for_docking() - + else if (control_mode == MODE_CLIENT && dock_state == STATE_DOCKING && receive_tag == tag_target) dock_state = STATE_DOCKED broadcast_docking_status() @@ -100,19 +100,19 @@ response_sent = 0 else if (control_mode == MODE_SERVER && dock_state == STATE_DOCKING && receive_tag == tag_target) //client just sent us the confirmation back, we're done with the docking process received_confirm = 1 - + if ("request_dock") if (control_mode == MODE_NONE && dock_state == STATE_UNDOCKED) control_mode = MODE_SERVER - + dock_state = STATE_DOCKING broadcast_docking_status() - + tag_target = receive_tag if (!override_enabled) prepare_for_docking() send_docking_command(tag_target, "confirm_dock") //acknowledge the request - + if ("confirm_undock") if (control_mode == MODE_CLIENT && dock_state == STATE_UNDOCKING && receive_tag == tag_target) if (!override_enabled) @@ -125,7 +125,7 @@ if (control_mode == MODE_SERVER && dock_state == STATE_DOCKED && receive_tag == tag_target) dock_state = STATE_UNDOCKING broadcast_docking_status() - + if (!override_enabled) prepare_for_undocking() @@ -133,7 +133,7 @@ if (receive_tag == tag_target) reset() -/datum/computer/file/embedded_program/docking/process() +/datum/computer/file/embedded_program/docking/Process() switch(dock_state) if (STATE_DOCKING) //waiting for our docking port to be ready for docking if (ready_for_docking()) @@ -141,38 +141,38 @@ if (!response_sent) send_docking_command(tag_target, "confirm_dock") //tell the server we're ready response_sent = 1 - + else if (control_mode == MODE_SERVER && received_confirm) send_docking_command(tag_target, "confirm_dock") //tell the client we are done docking. - + dock_state = STATE_DOCKED broadcast_docking_status() - + if (!override_enabled) finish_docking() //server done docking! response_sent = 0 received_confirm = 0 - + if (STATE_UNDOCKING) if (ready_for_undocking()) if (control_mode == MODE_CLIENT) if (!response_sent) send_docking_command(tag_target, "confirm_undock") //tell the server we are OK to undock. response_sent = 1 - + else if (control_mode == MODE_SERVER && received_confirm) send_docking_command(tag_target, "confirm_undock") //tell the client we are done undocking. if (!override_enabled) finish_undocking() reset() //server is done undocking! - + if (response_sent || resend_counter > 0) resend_counter++ - + if (resend_counter >= MESSAGE_RESEND_TIME || (dock_state != STATE_DOCKING && dock_state != STATE_UNDOCKING)) response_sent = 0 resend_counter = 0 - + //handle invalid states if (control_mode == MODE_NONE && dock_state != STATE_UNDOCKED) if (tag_target) @@ -185,22 +185,22 @@ /datum/computer/file/embedded_program/docking/proc/initiate_docking(var/target) if (dock_state != STATE_UNDOCKED || control_mode == MODE_SERVER) //must be undocked and not serving another request to begin a new docking handshake return - + tag_target = target control_mode = MODE_CLIENT - + send_docking_command(tag_target, "request_dock") /datum/computer/file/embedded_program/docking/proc/initiate_undocking() if (dock_state != STATE_DOCKED || control_mode != MODE_CLIENT) //must be docked and must be client to start undocking return - + dock_state = STATE_UNDOCKING broadcast_docking_status() - + if (!override_enabled) prepare_for_undocking() - + send_docking_command(tag_target, "request_undock") //tell the docking port to start getting ready for docking - e.g. pressurize @@ -236,7 +236,7 @@ /datum/computer/file/embedded_program/docking/proc/reset() dock_state = STATE_UNDOCKED broadcast_docking_status() - + control_mode = MODE_NONE tag_target = null response_sent = 0 diff --git a/code/game/machinery/embedded_controller/docking_program_multi.dm b/code/game/machinery/embedded_controller/docking_program_multi.dm index a4ad7d2985aa9..327f3d004aa89 100644 --- a/code/game/machinery/embedded_controller/docking_program_multi.dm +++ b/code/game/machinery/embedded_controller/docking_program_multi.dm @@ -178,7 +178,7 @@ if ("finish_undocking") docking_enabled = 0 -/datum/computer/file/embedded_program/airlock/multi_docking/process() +/datum/computer/file/embedded_program/airlock/multi_docking/Process() ..() if (docking_enabled && !response_sent) diff --git a/code/game/machinery/embedded_controller/embedded_controller_base.dm b/code/game/machinery/embedded_controller/embedded_controller_base.dm index fef67fd765a98..1b6c7259fe742 100644 --- a/code/game/machinery/embedded_controller/embedded_controller_base.dm +++ b/code/game/machinery/embedded_controller/embedded_controller_base.dm @@ -22,11 +22,11 @@ obj/machinery/embedded_controller/radio/Destroy() if(program) program.receive_signal(signal, receive_method, receive_param) - //spawn(5) program.process() //no, program.process sends some signals and machines respond and we here again and we lag -rastaf0 + //spawn(5) program.Process() //no, program.process sends some signals and machines respond and we here again and we lag -rastaf0 -/obj/machinery/embedded_controller/process() +/obj/machinery/embedded_controller/Process() if(program) - program.process() + program.Process() update_icon() diff --git a/code/game/machinery/embedded_controller/embedded_program_base.dm b/code/game/machinery/embedded_controller/embedded_program_base.dm index 06507d9d5f99b..12c56f2b0192d 100644 --- a/code/game/machinery/embedded_controller/embedded_program_base.dm +++ b/code/game/machinery/embedded_controller/embedded_program_base.dm @@ -17,7 +17,7 @@ /datum/computer/file/embedded_program/proc/receive_signal(datum/signal/signal, receive_method, receive_param) return -/datum/computer/file/embedded_program/proc/process() +/datum/computer/file/embedded_program/Process() return /datum/computer/file/embedded_program/proc/post_signal(datum/signal/signal, comm_line) diff --git a/code/game/machinery/flasher.dm b/code/game/machinery/flasher.dm index 0a6a20a80fe89..0b5db3f51d2e4 100644 --- a/code/game/machinery/flasher.dm +++ b/code/game/machinery/flasher.dm @@ -140,7 +140,7 @@ active = 1 icon_state = "launcheract" - for(var/obj/machinery/flasher/M in GLOB.machines) + for(var/obj/machinery/flasher/M in SSmachines.machinery) if(M.id == src.id) spawn() M.flash() diff --git a/code/game/machinery/floodlight.dm b/code/game/machinery/floodlight.dm index 4c029ebf3b3a2..d0f372ea0f54b 100644 --- a/code/game/machinery/floodlight.dm +++ b/code/game/machinery/floodlight.dm @@ -35,7 +35,7 @@ overlays += "damage1" desc += " It is lightly damaged, repair it with a welder." -/obj/machinery/floodlight/process() +/obj/machinery/floodlight/Process() if(!on) return diff --git a/code/game/machinery/floor_light.dm b/code/game/machinery/floor_light.dm index 6a3f1e2fbd9cd..7446a6a54811c 100644 --- a/code/game/machinery/floor_light.dm +++ b/code/game/machinery/floor_light.dm @@ -78,7 +78,7 @@ var/list/floor_light_cache = list() update_brightness() return -/obj/machinery/floor_light/process() +/obj/machinery/floor_light/Process() ..() var/need_update if((!anchored || broken()) && on) diff --git a/code/game/machinery/hologram.dm b/code/game/machinery/hologram.dm index 894b3a95128ce..e764cedfbe665 100644 --- a/code/game/machinery/hologram.dm +++ b/code/game/machinery/hologram.dm @@ -89,7 +89,7 @@ var/const/HOLOPAD_MODE = RANGE_BASED if(last_request + 200 < world.time) //don't spam other people with requests either, you jerk! last_request = world.time var/list/holopadlist = list() - for(var/obj/machinery/hologram/holopad/H in GLOB.machines) + for(var/obj/machinery/hologram/holopad/H in SSmachines.machinery) if((H.z in GLOB.using_map.station_levels) && H.operable()) holopadlist["[H.loc.loc.name]"] = H //Define a list and fill it with the area of every holopad in the world holopadlist = sortAssoc(holopadlist) @@ -271,7 +271,7 @@ For the other part of the code, check silicon say.dm. Particularly robot talk.*/ return 1 -/obj/machinery/hologram/holopad/process() +/obj/machinery/hologram/holopad/Process() for (var/mob/living/silicon/ai/master in masters) var/active_ai = (master && !master.incapacitated() && master.client && master.eyeobj)//If there is an AI with an eye attached, it's not incapacitated, and it has a client if((stat & NOPOWER) || !active_ai) diff --git a/code/game/machinery/holosign.dm b/code/game/machinery/holosign.dm index 2f8aaa80f7987..fd5ec7cf6a393 100644 --- a/code/game/machinery/holosign.dm +++ b/code/game/machinery/holosign.dm @@ -61,7 +61,7 @@ active = !active update_icon() - for(var/obj/machinery/holosign/M in GLOB.machines) + for(var/obj/machinery/holosign/M in SSmachines.machinery) if (M.id == src.id) spawn( 0 ) M.toggle() diff --git a/code/game/machinery/igniter.dm b/code/game/machinery/igniter.dm index eced1326f54a6..717b066e0ac3f 100755 --- a/code/game/machinery/igniter.dm +++ b/code/game/machinery/igniter.dm @@ -41,7 +41,7 @@ ignite() return -/obj/machinery/igniter/process() //ugh why is this even in process()? +/obj/machinery/igniter/Process() //ugh why is this even in process()? if (on && powered() ) var/turf/location = src.loc if (isturf(location)) @@ -149,12 +149,12 @@ active = 1 icon_state = "launcheract" - for(var/obj/machinery/sparker/M in GLOB.machines) + for(var/obj/machinery/sparker/M in SSmachines.machinery) if (M.id == id) spawn( 0 ) M.ignite() - for(var/obj/machinery/igniter/M in GLOB.machines) + for(var/obj/machinery/igniter/M in SSmachines.machinery) if(M.id == id) M.ignite() diff --git a/code/game/machinery/iv_drip.dm b/code/game/machinery/iv_drip.dm index 6fca845bdf010..01626f214a793 100644 --- a/code/game/machinery/iv_drip.dm +++ b/code/game/machinery/iv_drip.dm @@ -74,7 +74,7 @@ return ..() -/obj/machinery/iv_drip/process() +/obj/machinery/iv_drip/Process() set background = 1 if(src.attached) diff --git a/code/game/machinery/kitchen/smartfridge.dm b/code/game/machinery/kitchen/smartfridge.dm index 2fe51de0a4200..bef8deddcf1d5 100644 --- a/code/game/machinery/kitchen/smartfridge.dm +++ b/code/game/machinery/kitchen/smartfridge.dm @@ -138,7 +138,7 @@ return 1 return 0 -/obj/machinery/smartfridge/drying_rack/process() +/obj/machinery/smartfridge/drying_rack/Process() ..() if(inoperable()) return @@ -172,7 +172,7 @@ qdel(S) return -/obj/machinery/smartfridge/process() +/obj/machinery/smartfridge/Process() if(stat & (BROKEN|NOPOWER)) return if(src.seconds_electrified > 0) diff --git a/code/game/machinery/machinery.dm b/code/game/machinery/machinery.dm index c254f5d79a416..62456d28b8100 100644 --- a/code/game/machinery/machinery.dm +++ b/code/game/machinery/machinery.dm @@ -141,7 +141,7 @@ Class Procs: component_parts -= A . = ..() -/obj/machinery/process()//If you dont use process or power why are you here +/obj/machinery/Process()//If you dont use process or power why are you here if(!(use_power || idle_power_usage || active_power_usage)) return PROCESS_KILL diff --git a/code/game/machinery/newscaster.dm b/code/game/machinery/newscaster.dm index 9b9c248d96e42..c4ac4d11bb400 100644 --- a/code/game/machinery/newscaster.dm +++ b/code/game/machinery/newscaster.dm @@ -957,7 +957,7 @@ obj/item/weapon/newspaper/attackby(obj/item/weapon/W as obj, mob/user as mob) return //Removed for now so these aren't even checked every tick. Left this here in-case Agouri needs it later. -///obj/machinery/newscaster/process() //Was thinking of doing the icon update through process, but multiple iterations per second does not +///obj/machinery/newscaster/Process() //Was thinking of doing the icon update through process, but multiple iterations per second does not // return //bode well with a newscaster network of 10+ machines. Let's just return it, as it's added in the machines list. /obj/machinery/newscaster/proc/newsAlert(var/news_call) //This isn't Agouri's work, for it is ugly and vile. diff --git a/code/game/machinery/nuclear_bomb.dm b/code/game/machinery/nuclear_bomb.dm index 3172eb6aba35d..5c06e13594353 100644 --- a/code/game/machinery/nuclear_bomb.dm +++ b/code/game/machinery/nuclear_bomb.dm @@ -54,7 +54,7 @@ var/global/orion_password = null auth = null return ..() -/obj/machinery/nuclearbomb/Process() +/obj/machinery/nuclearbomb/Process(var/wait) if (timing) timeleft = max(timeleft - (wait / 10), 0) if (timeleft <= 0) diff --git a/code/game/machinery/oxygen_pump.dm b/code/game/machinery/oxygen_pump.dm index 153b708786f30..3b79c75e895a6 100644 --- a/code/game/machinery/oxygen_pump.dm +++ b/code/game/machinery/oxygen_pump.dm @@ -158,7 +158,7 @@ to_chat(user, "It is missing a tank!") -/obj/machinery/oxygen_pump/process() +/obj/machinery/oxygen_pump/Process() if(breather) if(!can_apply_to_target(breather)) if(tank) diff --git a/code/game/machinery/portable_turret.dm b/code/game/machinery/portable_turret.dm index 3537cc4483d28..bc295fda81363 100644 --- a/code/game/machinery/portable_turret.dm +++ b/code/game/machinery/portable_turret.dm @@ -439,7 +439,7 @@ var/list/turret_icons spark_system.start() //creates some sparks because they look cool update_icon() -/obj/machinery/porta_turret/process() +/obj/machinery/porta_turret/Process() //the main machinery process if(stat & (NOPOWER|BROKEN)) diff --git a/code/game/machinery/recharger.dm b/code/game/machinery/recharger.dm index 6d4500b50e1b2..224cb94472658 100644 --- a/code/game/machinery/recharger.dm +++ b/code/game/machinery/recharger.dm @@ -82,7 +82,7 @@ obj/machinery/recharger/attack_hand(mob/user as mob) charging = null update_icon() -obj/machinery/recharger/process() +obj/machinery/recharger/Process() if(stat & (NOPOWER|BROKEN) || !anchored) update_use_power(0) icon_state = icon_state_idle diff --git a/code/game/machinery/rechargestation.dm b/code/game/machinery/rechargestation.dm index fd7a4e99ef6db..ec60e42051a04 100644 --- a/code/game/machinery/rechargestation.dm +++ b/code/game/machinery/rechargestation.dm @@ -40,7 +40,7 @@ /obj/machinery/recharge_station/proc/has_cell_power() return cell && cell.percent() > 0 -/obj/machinery/recharge_station/process() +/obj/machinery/recharge_station/Process() if(stat & (BROKEN)) return if(!cell) // Shouldn't be possible, but sanity check diff --git a/code/game/machinery/resleever.dm b/code/game/machinery/resleever.dm index 7acb9c8b639c6..23be33dceb153 100644 --- a/code/game/machinery/resleever.dm +++ b/code/game/machinery/resleever.dm @@ -43,7 +43,7 @@ return ..() -obj/machinery/resleever/process() +obj/machinery/resleever/Process() if(occupant) occupant.Paralyse(4) // We need to always keep the occupant sleeping if they're in here. diff --git a/code/game/machinery/spaceheater.dm b/code/game/machinery/spaceheater.dm index ac01caaee0818..08250981bc0bb 100644 --- a/code/game/machinery/spaceheater.dm +++ b/code/game/machinery/spaceheater.dm @@ -155,7 +155,7 @@ updateDialog() -/obj/machinery/space_heater/process() +/obj/machinery/space_heater/Process() if(on) if(powered() || (cell && cell.charge)) var/datum/gas_mixture/env = loc.return_air() diff --git a/code/game/machinery/status_display.dm b/code/game/machinery/status_display.dm index 20ddedd6778f2..5f2d8238d8572 100644 --- a/code/game/machinery/status_display.dm +++ b/code/game/machinery/status_display.dm @@ -65,7 +65,7 @@ var/list/status_icons_to_colour = list( radio_controller.add_object(src, frequency) // timed process -/obj/machinery/status_display/process() +/obj/machinery/status_display/Process() if(stat & NOPOWER) remove_display() return diff --git a/code/game/machinery/status_display_ai.dm b/code/game/machinery/status_display_ai.dm index c228c112d8729..08cb32341294b 100644 --- a/code/game/machinery/status_display_ai.dm +++ b/code/game/machinery/status_display_ai.dm @@ -40,7 +40,7 @@ var/list/ai_status_emotions = list( /proc/set_ai_status_displays(mob/user as mob) var/list/ai_emotions = get_ai_emotions(user.ckey) var/emote = input("Please, select a status!", "AI Status", null, null) in ai_emotions - for (var/obj/machinery/M in GLOB.machines) //change status + for (var/obj/machinery/M in SSmachines.machinery) //change status if(istype(M, /obj/machinery/ai_status_display)) var/obj/machinery/ai_status_display/AISD = M AISD.emotion = emote @@ -74,7 +74,7 @@ var/list/ai_status_emotions = list( var/emote = input("Please, select a status!", "AI Status", null, null) in ai_emotions src.emotion = emote -/obj/machinery/ai_status_display/process() +/obj/machinery/ai_status_display/Process() return /obj/machinery/ai_status_display/update_icon() diff --git a/code/game/machinery/suit_storage_unit.dm b/code/game/machinery/suit_storage_unit.dm index 089f875df3fc7..0fbdebf95cab2 100644 --- a/code/game/machinery/suit_storage_unit.dm +++ b/code/game/machinery/suit_storage_unit.dm @@ -1040,7 +1040,7 @@ src.updateUsrDialog() return -/obj/machinery/suit_cycler/process() +/obj/machinery/suit_cycler/Process() if(electrified > 0) electrified-- diff --git a/code/game/machinery/supplybeacon.dm b/code/game/machinery/supplybeacon.dm index 8bef78c55c027..424911dd6d801 100644 --- a/code/game/machinery/supplybeacon.dm +++ b/code/game/machinery/supplybeacon.dm @@ -98,7 +98,7 @@ deactivate() ..() -/obj/machinery/power/supply_beacon/process() +/obj/machinery/power/supply_beacon/Process() if(expended) return PROCESS_KILL if(!use_power) diff --git a/code/game/machinery/syndicatebeacon.dm b/code/game/machinery/syndicatebeacon.dm index aebe893e8f820..4e1fe05af9767 100644 --- a/code/game/machinery/syndicatebeacon.dm +++ b/code/game/machinery/syndicatebeacon.dm @@ -160,7 +160,7 @@ ..() //stealth direct power usage -/obj/machinery/power/singularity_beacon/process() +/obj/machinery/power/singularity_beacon/Process() if(!active) return PROCESS_KILL else diff --git a/code/game/machinery/telecomms/telecomunications.dm b/code/game/machinery/telecomms/telecomunications.dm index 8dddacba607af..6a5e12b62e245 100644 --- a/code/game/machinery/telecomms/telecomunications.dm +++ b/code/game/machinery/telecomms/telecomunications.dm @@ -170,7 +170,7 @@ var/global/list/obj/machinery/telecomms/telecomms_list = list() else on = 0 -/obj/machinery/telecomms/process() +/obj/machinery/telecomms/Process() update_power() // Check heat and generate some diff --git a/code/game/machinery/vending.dm b/code/game/machinery/vending.dm index 305628ebac0cc..188f8f0fab103 100644 --- a/code/game/machinery/vending.dm +++ b/code/game/machinery/vending.dm @@ -543,7 +543,7 @@ SSnano.update_uis(src) -/obj/machinery/vending/process() +/obj/machinery/vending/Process() if(stat & (BROKEN|NOPOWER)) return diff --git a/code/game/mecha/equipment/tools/medical_tools.dm b/code/game/mecha/equipment/tools/medical_tools.dm index e465263e1b98c..6d87c9dad3ba6 100644 --- a/code/game/mecha/equipment/tools/medical_tools.dm +++ b/code/game/mecha/equipment/tools/medical_tools.dm @@ -193,7 +193,7 @@ /datum/global_iterator/mech_sleeper -/datum/global_iterator/mech_sleeper/process(var/obj/item/mecha_parts/mecha_equipment/tool/sleeper/S) +/datum/global_iterator/mech_sleeper/Process(var/obj/item/mecha_parts/mecha_equipment/tool/sleeper/S) if(!S.chassis) S.set_ready_state(1) return stop() @@ -479,7 +479,7 @@ /datum/global_iterator/mech_synth delay = 100 -/datum/global_iterator/mech_synth/process(var/obj/item/mecha_parts/mecha_equipment/tool/syringe_gun/S) +/datum/global_iterator/mech_synth/Process(var/obj/item/mecha_parts/mecha_equipment/tool/syringe_gun/S) if(!S.chassis) return stop() var/energy_drain = S.energy_drain diff --git a/code/game/mecha/equipment/tools/tools.dm b/code/game/mecha/equipment/tools/tools.dm index 09cfa95c82c3b..cc117ff0a733b 100644 --- a/code/game/mecha/equipment/tools/tools.dm +++ b/code/game/mecha/equipment/tools/tools.dm @@ -652,7 +652,7 @@ /datum/global_iterator/mecha_repair_droid - process(var/obj/item/mecha_parts/mecha_equipment/repair_droid/RD as obj) + Process(var/obj/item/mecha_parts/mecha_equipment/repair_droid/RD as obj) if(!RD.chassis) stop() RD.set_ready_state(1) @@ -740,7 +740,7 @@ /datum/global_iterator/mecha_energy_relay - process(var/obj/item/mecha_parts/mecha_equipment/tesla_energy_relay/ER) + Process(var/obj/item/mecha_parts/mecha_equipment/tesla_energy_relay/ER) if(!ER.chassis || ER.chassis.hasInternalDamage(MECHA_INT_SHORT_CIRCUIT)) stop() ER.set_ready_state(1) @@ -878,7 +878,7 @@ /datum/global_iterator/mecha_generator - process(var/obj/item/mecha_parts/mecha_equipment/generator/EG) + Process(var/obj/item/mecha_parts/mecha_equipment/generator/EG) if(!EG.chassis) stop() EG.set_ready_state(1) @@ -927,7 +927,7 @@ /datum/global_iterator/mecha_generator/nuclear - process(var/obj/item/mecha_parts/mecha_equipment/generator/nuclear/EG) + Process(var/obj/item/mecha_parts/mecha_equipment/generator/nuclear/EG) if(..()) radiation_repository.radiate(EG, (EG.rad_per_cycle * 3)) return 1 diff --git a/code/game/mecha/mech_bay.dm b/code/game/mecha/mech_bay.dm index 79b865b9fdec5..1ca8cc8b6671b 100644 --- a/code/game/mecha/mech_bay.dm +++ b/code/game/mecha/mech_bay.dm @@ -61,7 +61,7 @@ active_power_usage = base_charge_rate -/obj/machinery/mech_recharger/process() +/obj/machinery/mech_recharger/Process() ..() if(!charging) use_power = 1 diff --git a/code/game/mecha/mech_fabricator.dm b/code/game/mecha/mech_fabricator.dm index 42e22c67a5314..01cac3a985e40 100644 --- a/code/game/mecha/mech_fabricator.dm +++ b/code/game/mecha/mech_fabricator.dm @@ -45,7 +45,7 @@ update_categories() . = ..() -/obj/machinery/mecha_part_fabricator/process() +/obj/machinery/mecha_part_fabricator/Process() ..() if(stat) return diff --git a/code/game/mecha/mecha.dm b/code/game/mecha/mecha.dm index 626b95e00f2a7..659f9484cc7b1 100644 --- a/code/game/mecha/mecha.dm +++ b/code/game/mecha/mecha.dm @@ -1733,7 +1733,7 @@ /datum/global_iterator/mecha_preserve_temp //normalizing cabin air temperature to 20 degrees celsius delay = 20 - process(var/obj/mecha/mecha) + Process(var/obj/mecha/mecha) if(mecha.cabin_air && mecha.cabin_air.volume > 0) var/delta = mecha.cabin_air.temperature - T20C mecha.cabin_air.temperature -= max(-10, min(10, round(delta/4,0.1))) @@ -1742,7 +1742,7 @@ /datum/global_iterator/mecha_tank_give_air delay = 15 - process(var/obj/mecha/mecha) + Process(var/obj/mecha/mecha) if(mecha.internal_tank) var/datum/gas_mixture/tank_air = mecha.internal_tank.return_air() var/datum/gas_mixture/cabin_air = mecha.cabin_air @@ -1775,7 +1775,7 @@ /datum/global_iterator/mecha_inertial_movement //inertial movement in space delay = 7 - process(var/obj/mecha/mecha as obj,direction) + Process(var/obj/mecha/mecha as obj,direction) if(direction) if(!step(mecha, direction)||mecha.check_for_support()) src.stop() @@ -1785,7 +1785,7 @@ /datum/global_iterator/mecha_internal_damage // processing internal damage - process(var/obj/mecha/mecha) + Process(var/obj/mecha/mecha) if(!mecha.hasInternalDamage()) return stop() if(mecha.hasInternalDamage(MECHA_INT_FIRE)) diff --git a/code/game/objects/effects/decals/Cleanable/humans.dm b/code/game/objects/effects/decals/Cleanable/humans.dm index a98f22718e62d..b89e6c6d146de 100644 --- a/code/game/objects/effects/decals/Cleanable/humans.dm +++ b/code/game/objects/effects/decals/Cleanable/humans.dm @@ -32,14 +32,14 @@ var/global/list/image/splatter_cache=list() if(invisibility != 100) invisibility = 100 amount = 0 - GLOB.processing_objects -= src + STOP_PROCESSING(SSobj, src) ..(ignore=1) /obj/effect/decal/cleanable/blood/hide() return /obj/effect/decal/cleanable/blood/Destroy() - GLOB.processing_objects -= src + STOP_PROCESSING(SSobj, src) return ..() /obj/effect/decal/cleanable/blood/Initialize() @@ -55,9 +55,9 @@ var/global/list/image/splatter_cache=list() blood_DNA |= B.blood_DNA.Copy() qdel(B) drytime = world.time + DRYING_TIME * (amount+1) - GLOB.processing_objects += src + START_PROCESSING(SSobj, src) -/obj/effect/decal/cleanable/blood/process() +/obj/effect/decal/cleanable/blood/Process() if(world.time > drytime) dry() @@ -117,7 +117,7 @@ var/global/list/image/splatter_cache=list() desc = drydesc color = adjust_brightness(color, -50) amount = 0 - GLOB.processing_objects -= src + STOP_PROCESSING(SSobj, src) /obj/effect/decal/cleanable/blood/attack_hand(mob/living/carbon/human/user) ..() diff --git a/code/game/objects/effects/force_portal.dm b/code/game/objects/effects/force_portal.dm index d35e739425eb2..501249b841fb8 100644 --- a/code/game/objects/effects/force_portal.dm +++ b/code/game/objects/effects/force_portal.dm @@ -12,13 +12,13 @@ /obj/effect/force_portal/Initialize(var/loc) . = ..() boom_time = world.time + 30 SECONDS - GLOB.processing_objects += src + START_PROCESSING(SSobj, src) /obj/effect/force_portal/Destroy() - GLOB.processing_objects -= src + STOP_PROCESSING(SSobj, src) . = ..() -/obj/effect/force_portal/process() +/obj/effect/force_portal/Process() if(boom_time && boom_time < world.time) boom() boom_time = 0 diff --git a/code/game/objects/effects/manifest.dm b/code/game/objects/effects/manifest.dm index 88d2d8754779f..ba4fc934dc11d 100644 --- a/code/game/objects/effects/manifest.dm +++ b/code/game/objects/effects/manifest.dm @@ -11,7 +11,7 @@ /obj/effect/manifest/proc/manifest() var/dat = "Crew Manifest:
" - for(var/mob/living/carbon/human/M in GLOB.mob_list) + for(var/mob/living/carbon/human/M in SSmobs.mob_list) dat += text(" [] - []
", M.name, M.get_assignment()) var/obj/item/weapon/paper/P = new /obj/item/weapon/paper( src.loc ) P.info = dat diff --git a/code/game/objects/effects/spiders.dm b/code/game/objects/effects/spiders.dm index 202b67adbfdb9..fedfcf5a0b023 100644 --- a/code/game/objects/effects/spiders.dm +++ b/code/game/objects/effects/spiders.dm @@ -81,20 +81,20 @@ New() pixel_x = rand(3,-3) pixel_y = rand(3,-3) - GLOB.processing_objects |= src + START_PROCESSING(SSobj, src) /obj/effect/spider/eggcluster/New(var/location, var/atom/parent) get_light_and_color(parent) ..() /obj/effect/spider/eggcluster/Destroy() - GLOB.processing_objects -= src + STOP_PROCESSING(SSobj, src) if(istype(loc, /obj/item/organ/external)) var/obj/item/organ/external/O = loc O.implants -= src . = ..() -/obj/effect/spider/eggcluster/process() +/obj/effect/spider/eggcluster/Process() amount_grown += rand(0,2) if(amount_grown >= 100) var/num = rand(1,3) @@ -139,7 +139,7 @@ if(dormant) GLOB.moved_event.register(src, src, /obj/effect/spider/spiderling/proc/disturbed) else - GLOB.processing_objects |= src + START_PROCESSING(SSobj, src) get_light_and_color(parent) . = ..() @@ -153,7 +153,7 @@ /obj/effect/spider/spiderling/Destroy() if(dormant) GLOB.moved_event.unregister(src, src, /obj/effect/spider/spiderling/proc/disturbed) - GLOB.processing_objects -= src + STOP_PROCESSING(SSobj, src) walk(src, 0) // Because we might have called walk_to, we must stop the walk loop or BYOND keeps an internal reference to us forever. . = ..() @@ -172,7 +172,7 @@ dormant = FALSE GLOB.moved_event.unregister(src, src, /obj/effect/spider/spiderling/proc/disturbed) - GLOB.processing_objects |= src + START_PROCESSING(SSobj, src) /obj/effect/spider/spiderling/Bump(atom/user) if(istype(user, /obj/structure/table)) @@ -189,7 +189,7 @@ if(health <= 0) die() -/obj/effect/spider/spiderling/process() +/obj/effect/spider/spiderling/Process() if(travelling_in_vent) if(istype(src.loc, /turf)) travelling_in_vent = 0 diff --git a/code/game/objects/items/devices/PDA/cart.dm b/code/game/objects/items/devices/PDA/cart.dm index f73c308dc8824..d0fa04c5f6ad5 100644 --- a/code/game/objects/items/devices/PDA/cart.dm +++ b/code/game/objects/items/devices/PDA/cart.dm @@ -256,7 +256,7 @@ var/list/sensors = list() var/obj/machinery/power/sensor/MS = null - for(var/obj/machinery/power/sensor/S in GLOB.machines) + for(var/obj/machinery/power/sensor/S in SSmachines.machinery) sensors.Add(list(list("name_tag" = S.name_tag))) if(S.name_tag == selected_sensor) MS = S diff --git a/code/game/objects/items/devices/PDA/manifest.dm b/code/game/objects/items/devices/PDA/manifest.dm index 5cd841caf90eb..0cb45996f94a0 100644 --- a/code/game/objects/items/devices/PDA/manifest.dm +++ b/code/game/objects/items/devices/PDA/manifest.dm @@ -163,10 +163,10 @@ name updates also zero the list; although they are not in data_core, synths are // Silicons do not have records. See also /datum/datacore/proc/get_manifest - for(var/mob/living/silicon/ai/ai in GLOB.mob_list) + for(var/mob/living/silicon/ai/ai in SSmobs.mob_list) bot[++bot.len] = list("name" = ai.name, "rank" = "Artificial Intelligence", "active" = null) - for(var/mob/living/silicon/robot/robot in GLOB.mob_list) + for(var/mob/living/silicon/robot/robot in SSmobs.mob_list) // No combat/syndicate cyborgs, no drones. if(robot.module && robot.module.hide_on_manifest) continue diff --git a/code/game/objects/items/devices/aicard.dm b/code/game/objects/items/devices/aicard.dm index 8dc8bc9959cb1..865e6fed0a9d6 100644 --- a/code/game/objects/items/devices/aicard.dm +++ b/code/game/objects/items/devices/aicard.dm @@ -58,14 +58,14 @@ if(flush > 0) flush = 0 to_chat(carded_ai,"Wiping process has been cancelled. Restoring core files from backups.") - GLOB.processing_objects -= src + STOP_PROCESSING(SSobj, src) else var/confirm = alert("Are you sure you want to wipe this card's memory? This takes [AI_FLUSH_TIME/10] seconds and can be cancelled.", "Confirm Wipe", "Yes", "No") if(confirm == "Yes" && (CanUseTopic(user, state) == STATUS_INTERACTIVE)) admin_attack_log(user, carded_ai, "Wiped using \the [src.name]", "Was wiped with \the [src.name]", "used \the [src.name] to wipe") flush = world.time + AI_FLUSH_TIME to_chat(carded_ai, "Your core files are being wiped!") - GLOB.processing_objects |= src + START_PROCESSING(SSobj, src) if (href_list["radio"]) carded_ai.aiRadio.disabledAi = text2num(href_list["radio"]) to_chat(carded_ai, "Your Subspace Transceiver has been [carded_ai.aiRadio.disabledAi ? "disabled" : "enabled"]!") @@ -89,7 +89,7 @@ else icon_state = "aicard" -/obj/item/weapon/aicard/process() +/obj/item/weapon/aicard/Process() if(world.time > flush) if(!carded_ai) flush = 0 diff --git a/code/game/objects/items/devices/flashlight.dm b/code/game/objects/items/devices/flashlight.dm index 7feacc2dffde8..276b410fe9c74 100644 --- a/code/game/objects/items/devices/flashlight.dm +++ b/code/game/objects/items/devices/flashlight.dm @@ -198,7 +198,7 @@ fuel = rand(800, 1000) // Sorry for changing this so much but I keep under-estimating how long X number of ticks last in seconds. ..() -/obj/item/device/flashlight/flare/process() +/obj/item/device/flashlight/flare/Process() var/turf/pos = get_turf(src) if(pos) pos.hotspot_expose(produce_heat, 5) @@ -207,7 +207,7 @@ turn_off() if(!fuel) src.icon_state = "[initial(icon_state)]-empty" - GLOB.processing_objects -= src + STOP_PROCESSING(SSobj, src) /obj/item/device/flashlight/flare/proc/turn_off() on = 0 @@ -229,7 +229,7 @@ on = TRUE force = on_damage damtype = "fire" - GLOB.processing_objects += src + START_PROCESSING(SSobj, src) update_icon() return 1 @@ -256,11 +256,11 @@ . = ..() STOP_PROCESSING(SSobj, src) -/obj/item/device/flashlight/glowstick/process() +/obj/item/device/flashlight/glowstick/Process() fuel = max(fuel - 1, 0) if(!fuel) turn_off() - GLOB.processing_objects -= src + STOP_PROCESSING(SSobj, src) update_icon() /obj/item/device/flashlight/glowstick/proc/turn_off() @@ -300,7 +300,7 @@ . = ..() if(.) user.visible_message("[user] cracks and shakes the glowstick.", "You crack and shake the glowstick, turning it on!") - GLOB.processing_objects += src + START_PROCESSING(SSobj, src) /obj/item/device/flashlight/glowstick/red name = "red glowstick" diff --git a/code/game/objects/items/devices/geiger.dm b/code/game/objects/items/devices/geiger.dm index 459565bc4b251..484eb74061b73 100644 --- a/code/game/objects/items/devices/geiger.dm +++ b/code/game/objects/items/devices/geiger.dm @@ -21,7 +21,7 @@ . = ..() STOP_PROCESSING(SSobj, src) -/obj/item/device/geiger/process() +/obj/item/device/geiger/Process() if(!scanning) return radiation_count = radiation_repository.get_rads_at_turf(get_turf(src)) diff --git a/code/game/objects/items/devices/radio/intercom.dm b/code/game/objects/items/devices/radio/intercom.dm index 9ea664d7536c7..01f0a8c1d7874 100644 --- a/code/game/objects/items/devices/radio/intercom.dm +++ b/code/game/objects/items/devices/radio/intercom.dm @@ -52,7 +52,7 @@ /obj/item/device/radio/intercom/New() ..() - GLOB.processing_objects += src + START_PROCESSING(SSobj, src) /obj/item/device/radio/intercom/department/medbay/Initialize() . = ..() @@ -95,7 +95,7 @@ internal_channels[num2text(RAID_FREQ)] = list(access_syndicate) /obj/item/device/radio/intercom/Destroy() - GLOB.processing_objects -= src + STOP_PROCESSING(SSobj, src) return ..() /obj/item/device/radio/intercom/attack_ai(mob/user as mob) @@ -108,7 +108,7 @@ spawn (0) attack_self(user) -/obj/item/device/radio/intercom/process() +/obj/item/device/radio/intercom/Process() if(((world.timeofday - last_tick) > 30) || ((world.timeofday - last_tick) < 0)) last_tick = world.timeofday diff --git a/code/game/objects/items/devices/suit_cooling.dm b/code/game/objects/items/devices/suit_cooling.dm index ca233a5b66f03..dd778232bcf02 100644 --- a/code/game/objects/items/devices/suit_cooling.dm +++ b/code/game/objects/items/devices/suit_cooling.dm @@ -43,7 +43,7 @@ . = ..() STOP_PROCESSING(SSobj, src) -/obj/item/device/suit_cooling_unit/process() +/obj/item/device/suit_cooling_unit/Process() if (!on || !cell) return diff --git a/code/game/objects/items/devices/suit_sensor_jammer.dm b/code/game/objects/items/devices/suit_sensor_jammer.dm index 8da2919e51652..bcc452c105359 100644 --- a/code/game/objects/items/devices/suit_sensor_jammer.dm +++ b/code/game/objects/items/devices/suit_sensor_jammer.dm @@ -177,7 +177,7 @@ obj/item/device/suit_sensor_jammer/ui_act(action, params) if(active) return FALSE active = TRUE - GLOB.processing_objects += src + START_PROCESSING(SSobj, src) jammer_method.enable() update_icon() return TRUE @@ -187,7 +187,7 @@ obj/item/device/suit_sensor_jammer/ui_act(action, params) return FALSE active = FALSE jammer_method.disable() - GLOB.processing_objects -= src + STOP_PROCESSING(SSobj, src) update_icon() return TRUE diff --git a/code/game/objects/items/devices/t_scanner.dm b/code/game/objects/items/devices/t_scanner.dm index c709cea3a07f2..9760b72d80c73 100644 --- a/code/game/objects/items/devices/t_scanner.dm +++ b/code/game/objects/items/devices/t_scanner.dm @@ -35,15 +35,15 @@ /obj/item/device/t_scanner/proc/set_active(var/active) on = active if(on) - GLOB.processing_objects.Add(src) + START_PROCESSING(SSobj, src) flicker = 0 else - GLOB.processing_objects.Remove(src) + STOP_PROCESSING(SSobj, src) set_user_client(null) update_icon() //If reset is set, then assume the client has none of our overlays, otherwise we only send new overlays. -/obj/item/device/t_scanner/process() +/obj/item/device/t_scanner/Process() if(!on) return //handle clients changing diff --git a/code/game/objects/items/devices/uplink.dm b/code/game/objects/items/devices/uplink.dm index 141e9d27ce9aa..0bb5d7dcd1c39 100644 --- a/code/game/objects/items/devices/uplink.dm +++ b/code/game/objects/items/devices/uplink.dm @@ -46,15 +46,15 @@ src.uplink_owner = owner world_uplinks += src uses = telecrystals - GLOB.processing_objects += src + START_PROCESSING(SSobj, src) /obj/item/device/uplink/Destroy() uplink_owner = null world_uplinks -= src - GLOB.processing_objects -= src + STOP_PROCESSING(SSobj, src) return ..() -/obj/item/device/uplink/process() +/obj/item/device/uplink/Process() if(world.time > next_offer_time) next_offer_time = world.time + offer_time discount_amount = pick(90;0.9, 80;0.8, 70;0.7, 60;0.6, 50;0.5, 40;0.4, 30;0.3, 20;0.2, 10;0.1) diff --git a/code/game/objects/items/glassjar.dm b/code/game/objects/items/glassjar.dm index e3009ba53c853..7bd6c579c5c8e 100644 --- a/code/game/objects/items/glassjar.dm +++ b/code/game/objects/items/glassjar.dm @@ -34,7 +34,7 @@ var/obj/effect/spider/spiderling/S = A user.visible_message("[user] scoops [S] into \the [src].", "You scoop [S] into \the [src].") S.forceMove(src) - GLOB.processing_objects.Remove(S) // No growing inside jars + STOP_PROCESSING(SSobj, S) contains = 3 update_icon() return @@ -59,7 +59,7 @@ for(var/obj/effect/spider/spiderling/S in src) S.dropInto(user.loc) user.visible_message("[user] releases [S] from \the [src].", "You release [S] from \the [src].") - GLOB.processing_objects.Add(S) // They can grow after being let out though + START_PROCESSING(SSobj, S) // They can grow after being let out though contains = 0 update_icon() return diff --git a/code/game/objects/items/weapons/candle.dm b/code/game/objects/items/weapons/candle.dm index 6d8829ad329b2..6b41cf013c4e5 100644 --- a/code/game/objects/items/weapons/candle.dm +++ b/code/game/objects/items/weapons/candle.dm @@ -49,10 +49,10 @@ for(var/mob/O in viewers(usr, null)) O.show_message(flavor_text, 1) set_light(CANDLE_LUM) - GLOB.processing_objects.Add(src) + START_PROCESSING(SSobj, src) -/obj/item/weapon/flame/candle/process() +/obj/item/weapon/flame/candle/Process() if(!lit) return wax-- diff --git a/code/game/objects/items/weapons/cigs_lighters.dm b/code/game/objects/items/weapons/cigs_lighters.dm index ddf33f4091dc3..2cb404b7188bb 100644 --- a/code/game/objects/items/weapons/cigs_lighters.dm +++ b/code/game/objects/items/weapons/cigs_lighters.dm @@ -45,7 +45,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM slot_flags = SLOT_EARS attack_verb = list("burnt", "singed") -/obj/item/weapon/flame/match/process() +/obj/item/weapon/flame/match/Process() if(isliving(loc)) var/mob/living/M = loc M.IgniteMob() @@ -77,7 +77,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM item_state = "cigoff" name = "burnt match" desc = "A match. This one has seen better days." - GLOB.processing_objects.Remove(src) + STOP_PROCESSING(SSobj, src) ////////////////// //FINE SMOKABLES// @@ -118,7 +118,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM else // else just remove some of the reagents reagents.remove_any(REM) -/obj/item/clothing/mask/smokable/process() +/obj/item/clothing/mask/smokable/Process() var/turf/location = get_turf(src) smoke(1) if(smoketime < 1) @@ -162,12 +162,12 @@ CIGARETTE PACKETS ARE IN FANCY.DM var/turf/T = get_turf(src) T.visible_message(flavor_text) set_light(2, 0.25, "#E38F46") - GLOB.processing_objects.Add(src) + START_PROCESSING(SSobj, src) /obj/item/clothing/mask/smokable/proc/die(var/nomessage = 0) set_light(0) lit = 0 - GLOB.processing_objects.Remove(src) + STOP_PROCESSING(SSobj, src) update_icon() /obj/item/clothing/mask/smokable/attackby(obj/item/weapon/W as obj, mob/user as mob) @@ -438,7 +438,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM item_state = icon_on var/turf/T = get_turf(src) T.visible_message(flavor_text) - GLOB.processing_objects.Add(src) + START_PROCESSING(SSobj, src) if(ismob(loc)) var/mob/living/M = loc M.update_inv_wear_mask(0) @@ -458,7 +458,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM user.visible_message("[user] puts out [src].", "You put out [src].") lit = 0 update_icon() - GLOB.processing_objects.Remove(src) + STOP_PROCESSING(SSobj, src) else if (smoketime) var/turf/location = get_turf(user) user.visible_message("[user] empties out [src].", "You empty out [src].") @@ -540,7 +540,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM update_icon() light_effects(user) set_light(2) - GLOB.processing_objects.Add(src) + START_PROCESSING(SSobj, src) /obj/item/weapon/flame/lighter/proc/light_effects(mob/living/carbon/user) if(prob(95)) @@ -562,7 +562,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM else visible_message("[src] goes out.") set_light(0) - GLOB.processing_objects.Remove(src) + STOP_PROCESSING(SSobj, src) /obj/item/weapon/flame/lighter/proc/shutoff_effects(mob/user) user.visible_message("[user] quietly shuts off the [src].") @@ -633,7 +633,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM ..() -/obj/item/weapon/flame/lighter/process() +/obj/item/weapon/flame/lighter/Process() if(reagents.has_reagent(/datum/reagent/fuel)) if(ismob(loc) && prob(10) && reagents.get_reagent_amount(/datum/reagent/fuel) < 1) to_chat(loc, "[src]'s flame flickers.") diff --git a/code/game/objects/items/weapons/defib.dm b/code/game/objects/items/weapons/defib.dm index 223860a02ee97..352a15230f28f 100644 --- a/code/game/objects/items/weapons/defib.dm +++ b/code/game/objects/items/weapons/defib.dm @@ -530,7 +530,7 @@ /obj/item/weapon/shockpaddles/standalone/Destroy() . = ..() if(fail_counter) - GLOB.processing_objects.Remove(src) + STOP_PROCESSING(SSobj, src) /obj/item/weapon/shockpaddles/standalone/check_charge(var/charge_amt) return 1 @@ -539,11 +539,11 @@ radiation_repository.radiate(src, charge_amt/12) //just a little bit of radiation. It's the price you pay for being powered by magic I guess return 1 -/obj/item/weapon/shockpaddles/standalone/process() +/obj/item/weapon/shockpaddles/standalone/Process() if(fail_counter > 0) radiation_repository.radiate(src, fail_counter--) else - GLOB.processing_objects.Remove(src) + STOP_PROCESSING(SSobj, src) /obj/item/weapon/shockpaddles/standalone/emp_act(severity) ..() @@ -558,7 +558,7 @@ to_chat(loc, "\The [src] feel pleasantly warm.") if(new_fail && !fail_counter) - GLOB.processing_objects.Add(src) + START_PROCESSING(SSobj, src) fail_counter = new_fail /obj/item/weapon/shockpaddles/standalone/traitor diff --git a/code/game/objects/items/weapons/ecigs.dm b/code/game/objects/items/weapons/ecigs.dm index 4cdf168db6e43..dfcc4bbc21386 100644 --- a/code/game/objects/items/weapons/ecigs.dm +++ b/code/game/objects/items/weapons/ecigs.dm @@ -44,13 +44,13 @@ icon_empty = "ccigoff" icon_on = "ccigon" -/obj/item/clothing/mask/smokable/ecig/process() +/obj/item/clothing/mask/smokable/ecig/Process() if(ishuman(loc)) var/mob/living/carbon/human/C = loc if (src == C.wear_mask && C.check_has_mouth()) // if it's in the human/monkey mouth, transfer reagents to the mob if (!active || !ec_cartridge || !ec_cartridge.reagents.total_volume)//no cartridge active=0//autodisable the cigarette - GLOB.processing_objects.Remove(src) + STOP_PROCESSING(SSobj, src) update_icon() return ec_cartridge.reagents.trans_to_mob(C, REM, CHEM_INGEST, 0.4) // Most of it is not inhaled... balance reasons. @@ -89,7 +89,7 @@ /obj/item/clothing/mask/smokable/ecig/attack_self(mob/user as mob) if (active) active=0 - GLOB.processing_objects.Remove(src) + STOP_PROCESSING(SSobj, src) to_chat(user, "You turn off [src]. ") update_icon() else @@ -97,7 +97,7 @@ to_chat(user, "Insert cartridge first. ") return active=1 - GLOB.processing_objects.Add(src) + START_PROCESSING(SSobj, src) to_chat(user, "You turn on [src]. ") update_icon() diff --git a/code/game/objects/items/weapons/flamethrower.dm b/code/game/objects/items/weapons/flamethrower.dm index e468c9b0f306e..dc4f1772f0190 100644 --- a/code/game/objects/items/weapons/flamethrower.dm +++ b/code/game/objects/items/weapons/flamethrower.dm @@ -29,9 +29,9 @@ QDEL_NULL(ptank) . = ..() -/obj/item/weapon/flamethrower/process() +/obj/item/weapon/flamethrower/Process() if(!lit) - GLOB.processing_objects.Remove(src) + STOP_PROCESSING(SSobj, src) return null var/turf/location = loc if(istype(location, /mob/)) @@ -179,7 +179,7 @@ if(!status) return lit = !lit if(lit) - GLOB.processing_objects.Add(src) + START_PROCESSING(SSobj, src) if(href_list["amount"]) max_release_pressure = max_release_pressure + text2num(href_list["amount"]) max_release_pressure = max(1, min(40, max_release_pressure)) diff --git a/code/game/objects/items/weapons/grenades/supermatter.dm b/code/game/objects/items/weapons/grenades/supermatter.dm index 0d42cd8b89f3d..03e12085c6f96 100644 --- a/code/game/objects/items/weapons/grenades/supermatter.dm +++ b/code/game/objects/items/weapons/grenades/supermatter.dm @@ -8,12 +8,12 @@ /obj/item/weapon/grenade/supermatter/Destroy() if(implode_at) - GLOB.processing_objects -= src + STOP_PROCESSING(SSobj, src) . = ..() /obj/item/weapon/grenade/supermatter/detonate() ..() - GLOB.processing_objects += src + START_PROCESSING(SSobj, src) implode_at = world.time + 10 SECONDS update_icon() playsound(src, 'sound/weapons/wave.ogg', 100) @@ -23,7 +23,7 @@ if(implode_at) overlays += image(icon = 'icons/obj/machines/power/fusion.dmi', icon_state = "emfield_s1") -/obj/item/weapon/grenade/supermatter/process() +/obj/item/weapon/grenade/supermatter/Process() if(!isturf(loc)) if(ismob(loc)) var/mob/M = loc diff --git a/code/game/objects/items/weapons/implants/implants/death_alarm.dm b/code/game/objects/items/weapons/implants/implants/death_alarm.dm index cbe2ce8392f72..6b1c32ec2da88 100644 --- a/code/game/objects/items/weapons/implants/implants/death_alarm.dm +++ b/code/game/objects/items/weapons/implants/implants/death_alarm.dm @@ -19,7 +19,7 @@ /obj/item/weapon/implant/death_alarm/islegal() return TRUE -/obj/item/weapon/implant/death_alarm/process() +/obj/item/weapon/implant/death_alarm/Process() if (!implanted) return var/mob/M = imp_in @@ -40,7 +40,7 @@ var/death_message = "[mobname] has died in [location]!" if(!cause) death_message = "[mobname] has died-zzzzt in-in-in..." - GLOB.processing_objects.Remove(src) + STOP_PROCESSING(SSobj, src) for(var/channel in list("Security", "Medical", "Command")) GLOB.global_announcer.autosay(death_message, "[mobname]'s Death Alarm", channel) @@ -57,19 +57,19 @@ meltdown() else if (prob(60)) //but more likely it will just quietly die malfunction = MALFUNCTION_PERMANENT - GLOB.processing_objects.Remove(src) + STOP_PROCESSING(SSobj, src) spawn(20) malfunction = 0 /obj/item/weapon/implant/death_alarm/implanted(mob/source as mob) mobname = source.real_name - GLOB.processing_objects.Add(src) + START_PROCESSING(SSobj, src) return TRUE /obj/item/weapon/implant/death_alarm/removed() ..() - GLOB.processing_objects.Remove(src) + STOP_PROCESSING(SSobj, src) /obj/item/weapon/implantcase/death_alarm name = "glass case - 'death alarm'" diff --git a/code/game/objects/items/weapons/material/material_weapons.dm b/code/game/objects/items/weapons/material/material_weapons.dm index 8a531f61e5a96..7f9d23145ca99 100644 --- a/code/game/objects/items/weapons/material/material_weapons.dm +++ b/code/game/objects/items/weapons/material/material_weapons.dm @@ -58,7 +58,7 @@ if(applies_material_colour) color = material.icon_colour if(material.products_need_process()) - GLOB.processing_objects |= src + START_PROCESSING(SSobj, src) if(material.conductive) flags |= CONDUCT else @@ -66,7 +66,7 @@ update_force() /obj/item/weapon/material/Destroy() - GLOB.processing_objects -= src + STOP_PROCESSING(SSobj, src) . = ..() /obj/item/weapon/material/apply_hit_effect() @@ -94,7 +94,7 @@ qdel(src) /* Commenting this out pending rebalancing of radiation based on small objects. -/obj/item/weapon/material/process() +/obj/item/weapon/material/Process() if(!material.radioactivity) return for(var/mob/living/L in range(1,src)) diff --git a/code/game/objects/items/weapons/melee/energy.dm b/code/game/objects/items/weapons/melee/energy.dm index c44e53044727e..d4bbdb468b124 100644 --- a/code/game/objects/items/weapons/melee/energy.dm +++ b/code/game/objects/items/weapons/melee/energy.dm @@ -182,7 +182,7 @@ spark_system.set_up(5, 0, src) spark_system.attach(src) - GLOB.processing_objects |= src + START_PROCESSING(SSobj, src) /obj/item/weapon/melee/energy/blade/Initialize() . = ..() @@ -203,7 +203,7 @@ ..() spawn(1) if(src) qdel(src) -/obj/item/weapon/melee/energy/blade/process() +/obj/item/weapon/melee/energy/blade/Process() if(!creator || loc != creator || (creator.l_hand != src && creator.r_hand != src)) // Tidy up a bit. if(istype(loc,/mob/living)) diff --git a/code/game/objects/items/weapons/storage/boxes.dm b/code/game/objects/items/weapons/storage/boxes.dm index added84ba7495..c7c2fd91e3a81 100644 --- a/code/game/objects/items/weapons/storage/boxes.dm +++ b/code/game/objects/items/weapons/storage/boxes.dm @@ -330,7 +330,7 @@ W.lit = 1 W.damtype = "burn" W.icon_state = "match_lit" - GLOB.processing_objects.Add(W) + START_PROCESSING(SSobj, W) W.update_icon() return diff --git a/code/game/objects/items/weapons/tanks/tanks.dm b/code/game/objects/items/weapons/tanks/tanks.dm index 2b989e8070dcb..4405d83b9a6bf 100644 --- a/code/game/objects/items/weapons/tanks/tanks.dm +++ b/code/game/objects/items/weapons/tanks/tanks.dm @@ -62,14 +62,14 @@ var/list/global/tank_gauge_cache = list() src.air_contents = new /datum/gas_mixture() src.air_contents.volume = volume //liters src.air_contents.temperature = T20C - GLOB.processing_objects.Add(src) + START_PROCESSING(SSobj, src) update_gauge() return /obj/item/weapon/tank/Destroy() QDEL_NULL(air_contents) - GLOB.processing_objects.Remove(src) + STOP_PROCESSING(SSobj, src) QDEL_NULL(src.proxyassembly) if(istype(loc, /obj/item/device/transfer_valve)) @@ -351,7 +351,7 @@ var/list/global/tank_gauge_cache = list() return remove_air(moles_needed) -/obj/item/weapon/tank/process() +/obj/item/weapon/tank/Process() //Allow for reactions air_contents.react() //cooking up air tanks - add phoron and oxygen, then heat above PHORON_MINIMUM_BURN_TEMPERATURE if(gauge_icon) diff --git a/code/game/objects/items/weapons/tools.dm b/code/game/objects/items/weapons/tools.dm index 3d208b0131dd9..b39d5a95a3b4d 100644 --- a/code/game/objects/items/weapons/tools.dm +++ b/code/game/objects/items/weapons/tools.dm @@ -183,7 +183,7 @@ /obj/item/weapon/weldingtool/Destroy() if(welding) - GLOB.processing_objects -= src + STOP_PROCESSING(SSobj, src) return ..() /obj/item/weapon/weldingtool/examine(mob/user) @@ -229,7 +229,7 @@ return -/obj/item/weapon/weldingtool/process() +/obj/item/weapon/weldingtool/Process() if(welding) if(!remove_fuel(0.05)) setWelding(0) @@ -329,14 +329,14 @@ src.damtype = "fire" welding = 1 update_icon() - GLOB.processing_objects |= src + START_PROCESSING(SSobj, src) else if(M) to_chat(M, "You need more welding fuel to complete this task.") return //Otherwise else if(!set_welding && welding) - GLOB.processing_objects -= src + STOP_PROCESSING(SSobj, src) if(M) to_chat(M, "You switch \the [src] off.") else if(T) diff --git a/code/game/objects/structures/crates_lockers/closets/statue.dm b/code/game/objects/structures/crates_lockers/closets/statue.dm index e36603664f082..65977c2fcf156 100644 --- a/code/game/objects/structures/crates_lockers/closets/statue.dm +++ b/code/game/objects/structures/crates_lockers/closets/statue.dm @@ -43,10 +43,10 @@ qdel(src) return - GLOB.processing_objects.Add(src) + START_PROCESSING(SSobj, src) ..() -/obj/structure/closet/statue/process() +/obj/structure/closet/statue/Process() timer-- for(var/mob/living/M in src) //Go-go gadget stasis field M.setToxLoss(intialTox) @@ -55,7 +55,7 @@ M.setOxyLoss(intialOxy) if (timer <= 0) dump_contents() - GLOB.processing_objects.Remove(src) + STOP_PROCESSING(SSobj, src) qdel(src) /obj/structure/closet/statue/dump_contents() diff --git a/code/game/objects/structures/watercloset.dm b/code/game/objects/structures/watercloset.dm index 1fa327fcc9850..901230c9a363c 100644 --- a/code/game/objects/structures/watercloset.dm +++ b/code/game/objects/structures/watercloset.dm @@ -248,7 +248,7 @@ reagents.splash(O, 10) -/obj/machinery/shower/process() +/obj/machinery/shower/Process() if(!on) return for(var/thing in loc) diff --git a/code/game/response_team.dm b/code/game/response_team.dm index 9680cb2258fc8..3b94711130ba1 100644 --- a/code/game/response_team.dm +++ b/code/game/response_team.dm @@ -64,7 +64,7 @@ client/verb/JoinResponseTeam() proc/percentage_dead() var/total = 0 var/deadcount = 0 - for(var/mob/living/carbon/human/H in GLOB.mob_list) + for(var/mob/living/carbon/human/H in SSmobs.mob_list) if(H.client) // Monkeys and mice don't have a client, amirite? if(H.stat == 2) deadcount++ total++ @@ -76,7 +76,7 @@ proc/percentage_dead() proc/percentage_antagonists() var/total = 0 var/antagonists = 0 - for(var/mob/living/carbon/human/H in GLOB.mob_list) + for(var/mob/living/carbon/human/H in SSmobs.mob_list) if(is_special_character(H) >= 1) antagonists++ total++ diff --git a/code/game/supplyshuttle.dm b/code/game/supplyshuttle.dm index 155173fd9948d..359dfa00899db 100644 --- a/code/game/supplyshuttle.dm +++ b/code/game/supplyshuttle.dm @@ -156,7 +156,7 @@ var/list/point_source_descriptions = list( // Supply shuttle ticker - handles supply point regeneration // This is called by the process scheduler every thirty seconds - proc/process() + Process() add_points_from_source(points_per_process, "time") //To stop things being sent to centcomm which should not be sent to centcomm. Recursively checks for these types. diff --git a/code/game/turfs/biome.dm b/code/game/turfs/biome.dm index 06c841f6b3a0f..93eef9c3cede9 100644 --- a/code/game/turfs/biome.dm +++ b/code/game/turfs/biome.dm @@ -16,7 +16,7 @@ /obj/effect/landmark/biome/New() ..() if(atom_types.len || turf_types.len) - GLOB.processing_objects.Add(src) + START_PROCESSING(SSobj, src) var/turf/my_turf = get_turf(src) my_area = my_turf.loc my_turfs = get_area_turfs(my_area) @@ -25,14 +25,14 @@ if(turf_types.len) chosen_turf_type = pick(turf_types) -/obj/effect/landmark/biome/process() +/obj/effect/landmark/biome/Process() set background = 1 var/tiles_processed = 0 while(tiles_processed < tiles_per_tick) //check if we are finished if(turf_index > my_turfs.len) - GLOB.processing_objects.Remove(src) + STOP_PROCESSING(SSobj, src) log_admin("[src] [src.type] ([src.x],[src.y],[src.z]) has finished processing in [my_area] [my_area.type]. Time taken: [(world.time-time_start)/10] seconds.") qdel(src) break diff --git a/code/game/turfs/daynight_cycle.dm b/code/game/turfs/daynight_cycle.dm index ef0eabf19ba78..2765469eaa700 100644 --- a/code/game/turfs/daynight_cycle.dm +++ b/code/game/turfs/daynight_cycle.dm @@ -41,10 +41,10 @@ /obj/effect/landmark/day_night_zcontroller/Initialize() ..() - GLOB.processing_objects.Add(src) + START_PROCESSING(SSobj, src) return INITIALIZE_HINT_NORMAL -/obj/effect/landmark/day_night_zcontroller/process() +/obj/effect/landmark/day_night_zcontroller/Process() //its a new day if(world.time + solar_cycle_offset > solar_cycle_start + solar_cycle_duration) diff --git a/code/game/turfs/simulated/walls.dm b/code/game/turfs/simulated/walls.dm index c0462f3d6e1d4..00ac803a2edf7 100644 --- a/code/game/turfs/simulated/walls.dm +++ b/code/game/turfs/simulated/walls.dm @@ -55,7 +55,7 @@ var/obj/O = A return (istype(O) && O.hides_under_flooring()) || ..() -/turf/simulated/wall/process(wait = 1, times_fired = 0) +/turf/simulated/wall/Process(wait = 1, times_fired = 0) var/how_often = max(round(2 SECONDS/wait), 1) if(times_fired % how_often) return //We only work about every 2 seconds diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm index 87720ee838c58..4146ac6199c0f 100644 --- a/code/game/turfs/turf.dm +++ b/code/game/turfs/turf.dm @@ -218,7 +218,7 @@ var/const/enterloopsanity = 100 L.Add(t) return L -/turf/proc/process() +/turf/Process() return PROCESS_KILL /turf/proc/contains_dense_objects() diff --git a/code/game/world.dm b/code/game/world.dm index bbf228a8a6a01..4a869eff9e337 100644 --- a/code/game/world.dm +++ b/code/game/world.dm @@ -36,7 +36,7 @@ var/list/match = list() - for(var/mob/M in GLOB.mob_list) + for(var/mob/M in SSmobs.mob_list) if(restrict_type && !istype(M, restrict_type)) continue var/strings = list(M.name, M.ckey) diff --git a/code/modules/ZAS/Fire.dm b/code/modules/ZAS/Fire.dm index 4a234869c3078..97382a6a9471a 100644 --- a/code/modules/ZAS/Fire.dm +++ b/code/modules/ZAS/Fire.dm @@ -103,7 +103,7 @@ turf/proc/hotspot_expose(exposed_temperature, exposed_volume, soh = 0) zone.fire_tiles |= src if(fuel) zone.fuel_objs += fuel - fire.process() + fire.Process() return 0 @@ -123,7 +123,7 @@ turf/proc/hotspot_expose(exposed_temperature, exposed_volume, soh = 0) var/firelevel = 1 //Calculated by gas_mixture.calculate_firelevel() -/obj/fire/process() +/obj/fire/Process() . = 1 var/turf/simulated/my_tile = loc diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm index 204b00fd5c40f..486d63ce8eb56 100644 --- a/code/modules/admin/admin.dm +++ b/code/modules/admin/admin.dm @@ -27,12 +27,12 @@ var/global/floorIsLava = 0 var/msg = rendered to_chat(C, msg) /proc/admin_notice(var/message, var/rights) - for(var/mob/M in GLOB.mob_list) + for(var/mob/M in SSmobs.mob_list) if(check_rights(rights, 0, M)) to_chat(M, message) ///////////////////////////////////////////////////////////////////////////////////////////////Panels -/datum/admins/proc/show_player_panel(var/mob/M in GLOB.mob_list) +/datum/admins/proc/show_player_panel(var/mob/M in SSmobs.mob_list) set category = "Admin" set name = "Show Player Panel" set desc="Edit player (respawn, ban, heal, etc)" @@ -961,7 +961,7 @@ var/global/floorIsLava = 0 world.Reboot() -/datum/admins/proc/unprison(var/mob/M in GLOB.mob_list) +/datum/admins/proc/unprison(var/mob/M in SSmobs.mob_list) set category = "Admin" set name = "Unprison" if (isAdminLevel(M.z)) @@ -1102,7 +1102,7 @@ var/global/floorIsLava = 0 feedback_add_details("admin_verb","SA") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! -/datum/admins/proc/show_traitor_panel(var/mob/M in GLOB.mob_list) +/datum/admins/proc/show_traitor_panel(var/mob/M in SSmobs.mob_list) set category = "Admin" set desc = "Edit mobs's memory and role" set name = "Show Traitor Panel" @@ -1218,7 +1218,7 @@ var/global/floorIsLava = 0 /datum/admins/proc/output_ai_laws() var/ai_number = 0 - for(var/mob/living/silicon/S in GLOB.mob_list) + for(var/mob/living/silicon/S in SSmobs.mob_list) ai_number++ if(isAI(S)) to_chat(usr, "AI [key_name(S, usr)]'s laws:") diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index ef0e0b524574d..110c26370eee7 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -594,7 +594,7 @@ var/list/admin_verbs_mentor = list( log_and_message_admins("created an admin explosion at [epicenter.loc].") feedback_add_details("admin_verb","DB") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! -/client/proc/give_disease2(mob/T as mob in GLOB.mob_list) // -- Giacom +/client/proc/give_disease2(mob/T as mob in SSmobs.mob_list) // -- Giacom set category = "Fun" set name = "Give Disease" set desc = "Gives a Disease to a mob." @@ -929,7 +929,7 @@ var/list/admin_verbs_mentor = list( to_chat(src, "Enabled maint drones.") message_admins("Admin [key_name_admin(usr)] has enabled maint drones.", 1) -/client/proc/man_up(mob/T as mob in GLOB.mob_list) +/client/proc/man_up(mob/T as mob in SSmobs.mob_list) set category = "Fun" set name = "Man Up" set desc = "Tells mob to man up and deal with it." @@ -944,13 +944,13 @@ var/list/admin_verbs_mentor = list( set name = "Man Up Global" set desc = "Tells everyone to man up and deal with it." - for (var/mob/T as mob in GLOB.mob_list) + for (var/mob/T as mob in SSmobs.mob_list) to_chat(T, "
Man up.
Deal with it.

Move on.

") sound_to(T, 'sound/voice/ManUp1.ogg') log_and_message_admins("told everyone to man up and deal with it.") -/client/proc/give_spell(mob/T as mob in GLOB.mob_list) // -- Urist +/client/proc/give_spell(mob/T as mob in SSmobs.mob_list) // -- Urist set category = "Fun" set name = "Give Spell" set desc = "Gives a spell to a mob." diff --git a/code/modules/admin/buildmode/edit.dm b/code/modules/admin/buildmode/edit.dm index d48d96a77ed21..81e984fddf993 100644 --- a/code/modules/admin/buildmode/edit.dm +++ b/code/modules/admin/buildmode/edit.dm @@ -30,7 +30,7 @@ if("number") new_value = input(usr,"Enter variable value:" ,"Value", value_to_set) as num|null if("mob-reference") - new_value = input(usr,"Enter variable value:" ,"Value", value_to_set) as null|mob in GLOB.mob_list + new_value = input(usr,"Enter variable value:" ,"Value", value_to_set) as null|mob in SSmobs.mob_list if("obj-reference") new_value = input(usr,"Enter variable value:" ,"Value", value_to_set) as null|obj in world if("turf-reference") diff --git a/code/modules/admin/holoverbs.dm b/code/modules/admin/holoverbs.dm index 9bc29e0a6b934..c057cb4971059 100644 --- a/code/modules/admin/holoverbs.dm +++ b/code/modules/admin/holoverbs.dm @@ -7,7 +7,7 @@ if(!check_rights(R_FUN)) return var/list/AIs = list() - for(var/mob/living/silicon/ai/AI in GLOB.mob_list) + for(var/mob/living/silicon/ai/AI in SSmobs.mob_list) AIs += AI var/mob/living/silicon/ai/AI = input("Which AI do you want to apply [appear] to as a hologram?") as null|anything in AIs diff --git a/code/modules/admin/secrets/admin_secrets/list_dna.dm b/code/modules/admin/secrets/admin_secrets/list_dna.dm index 7492da9c3df8b..6b385791f4a6b 100644 --- a/code/modules/admin/secrets/admin_secrets/list_dna.dm +++ b/code/modules/admin/secrets/admin_secrets/list_dna.dm @@ -7,7 +7,7 @@ return var/dat = "Showing DNA from blood.
" dat += "" - for(var/mob/living/carbon/human/H in GLOB.mob_list) + for(var/mob/living/carbon/human/H in SSmobs.mob_list) if(H.dna && H.ckey) dat += "" dat += "
NameDNABlood Type
[H][H.dna.unique_enzymes][H.b_type]
" diff --git a/code/modules/admin/secrets/admin_secrets/list_fingerprints.dm b/code/modules/admin/secrets/admin_secrets/list_fingerprints.dm index 146d0ac77381c..3eefffc7d2ff8 100644 --- a/code/modules/admin/secrets/admin_secrets/list_fingerprints.dm +++ b/code/modules/admin/secrets/admin_secrets/list_fingerprints.dm @@ -7,7 +7,7 @@ return var/dat = "Showing Fingerprints.
" dat += "" - for(var/mob/living/carbon/human/H in GLOB.mob_list) + for(var/mob/living/carbon/human/H in SSmobs.mob_list) if(H.ckey) if(H.dna && H.dna.uni_identity) dat += "" diff --git a/code/modules/admin/secrets/admin_secrets/prison_warp.dm b/code/modules/admin/secrets/admin_secrets/prison_warp.dm index 8d79a6b1629f8..a253d61f11115 100644 --- a/code/modules/admin/secrets/admin_secrets/prison_warp.dm +++ b/code/modules/admin/secrets/admin_secrets/prison_warp.dm @@ -10,7 +10,7 @@ . = ..() if(!.) return - for(var/mob/living/carbon/human/H in GLOB.mob_list) + for(var/mob/living/carbon/human/H in SSmobs.mob_list) var/turf/T = get_turf(H) var/security = 0 if((T && (T in GLOB.using_map.admin_levels)) || GLOB.prisonwarped.Find(H)) diff --git a/code/modules/admin/secrets/fun_secrets/turn_humans_into_corgies.dm b/code/modules/admin/secrets/fun_secrets/turn_humans_into_corgies.dm index 4f3e58f200588..64dbce6a84565 100644 --- a/code/modules/admin/secrets/fun_secrets/turn_humans_into_corgies.dm +++ b/code/modules/admin/secrets/fun_secrets/turn_humans_into_corgies.dm @@ -6,6 +6,6 @@ if(!.) return - for(var/mob/living/carbon/human/H in GLOB.mob_list) + for(var/mob/living/carbon/human/H in SSmobs.mob_list) spawn(0) H.corgize() diff --git a/code/modules/admin/secrets/fun_secrets/turn_humans_into_monkeys.dm b/code/modules/admin/secrets/fun_secrets/turn_humans_into_monkeys.dm index 25901393b4165..611ece5a9051b 100644 --- a/code/modules/admin/secrets/fun_secrets/turn_humans_into_monkeys.dm +++ b/code/modules/admin/secrets/fun_secrets/turn_humans_into_monkeys.dm @@ -6,6 +6,6 @@ if(!.) return - for(var/mob/living/carbon/human/H in GLOB.mob_list) + for(var/mob/living/carbon/human/H in SSmobs.mob_list) spawn(0) H.monkeyize() diff --git a/code/modules/admin/verbs/adminhelp.dm b/code/modules/admin/verbs/adminhelp.dm index b43a64490e6d1..890ba931372ea 100644 --- a/code/modules/admin/verbs/adminhelp.dm +++ b/code/modules/admin/verbs/adminhelp.dm @@ -29,7 +29,7 @@ var/list/adminhelp_ignored_words = list("unknown","the","a","an","of","monkey"," var/list/surnames = list() var/list/forenames = list() var/list/ckeys = list() - for(var/mob/M in GLOB.mob_list) + for(var/mob/M in SSmobs.mob_list) var/list/indexing = list(M.real_name, M.name) if(M.mind) indexing += M.mind.name diff --git a/code/modules/admin/verbs/adminjump.dm b/code/modules/admin/verbs/adminjump.dm index 4896953a11380..d75ea88a5ac11 100644 --- a/code/modules/admin/verbs/adminjump.dm +++ b/code/modules/admin/verbs/adminjump.dm @@ -32,7 +32,7 @@ mob.jumpTo(T) feedback_add_details("admin_verb","JT") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! -/client/proc/jumptomob(var/mob/M in GLOB.mob_list) +/client/proc/jumptomob(var/mob/M in SSmobs.mob_list) set category = "Admin" set name = "Jump to Mob" @@ -94,7 +94,7 @@ else alert("Admin jumping disabled") -/client/proc/Getmob(var/mob/M in GLOB.mob_list) +/client/proc/Getmob(var/mob/M in SSmobs.mob_list) set category = "Admin" set name = "Get Mob" set desc = "Mob to teleport" diff --git a/code/modules/admin/verbs/adminpm.dm b/code/modules/admin/verbs/adminpm.dm index 8dd9bac66ab36..aa613f591793c 100644 --- a/code/modules/admin/verbs/adminpm.dm +++ b/code/modules/admin/verbs/adminpm.dm @@ -1,5 +1,5 @@ //allows right clicking mobs to send an admin PM to their client, forwards the selected mob's client to cmd_admin_pm -/client/proc/cmd_admin_pm_context(mob/M as mob in GLOB.mob_list) +/client/proc/cmd_admin_pm_context(mob/M as mob in SSmobs.mob_list) set category = null set name = "Admin PM Mob" if(!holder) diff --git a/code/modules/admin/verbs/atmosdebug.dm b/code/modules/admin/verbs/atmosdebug.dm index 065e10c5e46ea..8224146c09ab7 100644 --- a/code/modules/admin/verbs/atmosdebug.dm +++ b/code/modules/admin/verbs/atmosdebug.dm @@ -48,7 +48,7 @@ return feedback_add_details("admin_verb","CPOW") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - for (var/datum/powernet/PN in GLOB.powernets) + for (var/datum/powernet/PN in SSmachines.powernets) if (!PN.nodes || !PN.nodes.len) if(PN.cables && (PN.cables.len > 1)) var/obj/structure/cable/C = PN.cables[1] diff --git a/code/modules/admin/verbs/debug.dm b/code/modules/admin/verbs/debug.dm index adeafdaabe314..7dd29ea07576d 100644 --- a/code/modules/admin/verbs/debug.dm +++ b/code/modules/admin/verbs/debug.dm @@ -38,7 +38,7 @@ usr.show_message(t, 1) feedback_add_details("admin_verb","ASL") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! -/client/proc/cmd_admin_robotize(var/mob/M in GLOB.mob_list) +/client/proc/cmd_admin_robotize(var/mob/M in SSmobs.mob_list) set category = "Fun" set name = "Make Robot" @@ -53,7 +53,7 @@ else alert("Invalid mob") -/client/proc/cmd_admin_animalize(var/mob/M in GLOB.mob_list) +/client/proc/cmd_admin_animalize(var/mob/M in SSmobs.mob_list) set category = "Fun" set name = "Make Simple Animal" @@ -74,13 +74,13 @@ M.Animalize() -/client/proc/makepAI(var/turf/T in GLOB.mob_list) +/client/proc/makepAI(var/turf/T in SSmobs.mob_list) set category = "Fun" set name = "Make pAI" set desc = "Specify a location to spawn a pAI device, then specify a key to play that pAI" var/list/available = list() - for(var/mob/C in GLOB.mob_list) + for(var/mob/C in SSmobs.mob_list) if(C.key) available.Add(C) var/mob/choice = input("Choose a player to play the pAI", "Spawn pAI") in available @@ -101,7 +101,7 @@ paiController.pai_candidates.Remove(candidate) feedback_add_details("admin_verb","MPAI") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! -/client/proc/cmd_admin_slimeize(var/mob/M in GLOB.mob_list) +/client/proc/cmd_admin_slimeize(var/mob/M in SSmobs.mob_list) set category = "Fun" set name = "Make slime" @@ -241,7 +241,7 @@ message_admins("[key_name_admin(src)] has turned aliens [config.aliens_allowed ? "on" : "off"].", 0) feedback_add_details("admin_verb","TAL") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! -/client/proc/cmd_admin_grantfullaccess(var/mob/M in GLOB.mob_list) +/client/proc/cmd_admin_grantfullaccess(var/mob/M in SSmobs.mob_list) set category = "Admin" set name = "Grant Full Access" @@ -271,7 +271,7 @@ feedback_add_details("admin_verb","GFA") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! log_and_message_admins("has granted [M.key] full access.") -/client/proc/cmd_assume_direct_control(var/mob/M in GLOB.mob_list) +/client/proc/cmd_assume_direct_control(var/mob/M in SSmobs.mob_list) set category = "Admin" set name = "Assume direct control" set desc = "Direct intervention" @@ -470,7 +470,7 @@ if("Admins") to_chat(usr, jointext(GLOB.admins,",")) if("Mobs") - to_chat(usr, jointext(GLOB.mob_list,",")) + to_chat(usr, jointext(SSmobs.mob_list,",")) if("Living Mobs") to_chat(usr, jointext(GLOB.living_mob_list_,",")) if("Dead Mobs") diff --git a/code/modules/admin/verbs/massmodvar.dm b/code/modules/admin/verbs/massmodvar.dm index 3e711be994ec7..249bee2f35426 100644 --- a/code/modules/admin/verbs/massmodvar.dm +++ b/code/modules/admin/verbs/massmodvar.dm @@ -134,7 +134,7 @@ O.vars[variable] = initial(O.vars[variable]) if(method) if(istype(O, /mob)) - for(var/mob/M in GLOB.mob_list) + for(var/mob/M in SSmobs.mob_list) if ( istype(M , O.type) ) M.vars[variable] = O.vars[variable] @@ -150,7 +150,7 @@ else if(istype(O, /mob)) - for(var/mob/M in GLOB.mob_list) + for(var/mob/M in SSmobs.mob_list) if (M.type == O.type) M.vars[variable] = O.vars[variable] @@ -174,7 +174,7 @@ if(method) if(istype(O, /mob)) - for(var/mob/M in GLOB.mob_list) + for(var/mob/M in SSmobs.mob_list) if ( istype(M , O.type) ) M.vars[variable] = O.vars[variable] @@ -189,7 +189,7 @@ A.vars[variable] = O.vars[variable] else if(istype(O, /mob)) - for(var/mob/M in GLOB.mob_list) + for(var/mob/M in SSmobs.mob_list) if (M.type == O.type) M.vars[variable] = O.vars[variable] @@ -215,7 +215,7 @@ if(method) if(istype(O, /mob)) - for(var/mob/M in GLOB.mob_list) + for(var/mob/M in SSmobs.mob_list) if ( istype(M , O.type) ) if(variable=="light_range") M.set_light(new_value) @@ -240,7 +240,7 @@ else if(istype(O, /mob)) - for(var/mob/M in GLOB.mob_list) + for(var/mob/M in SSmobs.mob_list) if (M.type == O.type) if(variable=="light_range") M.set_light(new_value) @@ -270,7 +270,7 @@ O.vars[variable] = new_value if(method) if(istype(O, /mob)) - for(var/mob/M in GLOB.mob_list) + for(var/mob/M in SSmobs.mob_list) if ( istype(M , O.type) ) M.vars[variable] = O.vars[variable] @@ -285,7 +285,7 @@ A.vars[variable] = O.vars[variable] else if(istype(O, /mob)) - for(var/mob/M in GLOB.mob_list) + for(var/mob/M in SSmobs.mob_list) if (M.type == O.type) M.vars[variable] = O.vars[variable] @@ -306,7 +306,7 @@ if(method) if(istype(O, /mob)) - for(var/mob/M in GLOB.mob_list) + for(var/mob/M in SSmobs.mob_list) if ( istype(M , O.type) ) M.vars[variable] = O.vars[variable] @@ -321,7 +321,7 @@ A.vars[variable] = O.vars[variable] else if(istype(O, /mob)) - for(var/mob/M in GLOB.mob_list) + for(var/mob/M in SSmobs.mob_list) if (M.type == O.type) M.vars[variable] = O.vars[variable] @@ -341,7 +341,7 @@ O.vars[variable] = new_value if(method) if(istype(O, /mob)) - for(var/mob/M in GLOB.mob_list) + for(var/mob/M in SSmobs.mob_list) if ( istype(M , O.type) ) M.vars[variable] = O.vars[variable] @@ -357,7 +357,7 @@ else if(istype(O, /mob)) - for(var/mob/M in GLOB.mob_list) + for(var/mob/M in SSmobs.mob_list) if (M.type == O.type) M.vars[variable] = O.vars[variable] diff --git a/code/modules/admin/verbs/possess.dm b/code/modules/admin/verbs/possess.dm index 3a5af7221c459..7fd67edeec4b1 100644 --- a/code/modules/admin/verbs/possess.dm +++ b/code/modules/admin/verbs/possess.dm @@ -44,7 +44,7 @@ usr.control_object = null feedback_add_details("admin_verb","RO") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! -/proc/givetestverbs(mob/M as mob in GLOB.mob_list) +/proc/givetestverbs(mob/M as mob in SSmobs.mob_list) set desc = "Give this guy possess/release verbs" set category = "Debug" set name = "Give Possessing Verbs" diff --git a/code/modules/admin/verbs/randomverbs.dm b/code/modules/admin/verbs/randomverbs.dm index f71380f960e7a..7b39ee5ead25a 100644 --- a/code/modules/admin/verbs/randomverbs.dm +++ b/code/modules/admin/verbs/randomverbs.dm @@ -1,4 +1,4 @@ -/client/proc/cmd_admin_drop_everything(mob/M as mob in GLOB.mob_list) +/client/proc/cmd_admin_drop_everything(mob/M as mob in SSmobs.mob_list) set category = null set name = "Drop Everything" if(!holder) @@ -16,7 +16,7 @@ message_admins("[key_name_admin(usr)] made [key_name_admin(M)] drop everything!", 1) feedback_add_details("admin_verb","DEVR") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! -/client/proc/cmd_admin_prison(mob/M as mob in GLOB.mob_list) +/client/proc/cmd_admin_prison(mob/M as mob in SSmobs.mob_list) set category = "Admin" set name = "Prison" if(!holder) @@ -42,7 +42,7 @@ log_and_message_admins("sent [key_name_admin(M)] to the prison station.") feedback_add_details("admin_verb","PRISON") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! -/client/proc/cmd_admin_subtle_message(mob/M as mob in GLOB.mob_list) +/client/proc/cmd_admin_subtle_message(mob/M as mob in SSmobs.mob_list) set category = "Special Verbs" set name = "Subtle Message" @@ -138,7 +138,7 @@ log_and_message_admins(" - DirectNarrate to ([M.name]/[M.key]): [msg]") feedback_add_details("admin_verb","DIRN") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! -/client/proc/cmd_admin_godmode(mob/M as mob in GLOB.mob_list) +/client/proc/cmd_admin_godmode(mob/M as mob in SSmobs.mob_list) set category = "Special Verbs" set name = "Godmode" if(!holder) @@ -218,7 +218,7 @@ Ccomp's first proc. var/list/mobs = list() var/list/ghosts = list() - var/list/sortmob = sortAtom(GLOB.mob_list) // get the mob list. + var/list/sortmob = sortAtom(SSmobs.mob_list) // get the mob list. var/any=0 for(var/mob/observer/ghost/M in sortmob) mobs.Add(M) //filter it where it's only ghosts @@ -238,7 +238,7 @@ Ccomp's first proc. /client/proc/get_ghosts_by_key() . = list() - for(var/mob/observer/ghost/M in GLOB.mob_list) + for(var/mob/observer/ghost/M in SSmobs.mob_list) .[M.ckey] = M . = sortAssoc(.) @@ -455,14 +455,14 @@ Traitors and the like can also be revived with the previous role mostly intact. var/input = sanitize(input(usr, "Please enter anything you want the AI to do. Anything. Serious.", "What?", "") as text|null) if(!input) return - for(var/mob/living/silicon/ai/M in GLOB.mob_list) + for(var/mob/living/silicon/ai/M in SSmobs.mob_list) if (M.stat == 2) to_chat(usr, "Upload failed. No signal is being detected from the AI.") else if (M.see_in_dark == 0) to_chat(usr, "Upload failed. Only a faint signal is being detected from the AI, and it is not responding to our requests. It may be low on power.") else M.add_ion_law(input) - for(var/mob/living/silicon/ai/O in GLOB.mob_list) + for(var/mob/living/silicon/ai/O in SSmobs.mob_list) to_chat(O, "" + input + "...LAWS UPDATED") O.show_laws() @@ -474,7 +474,7 @@ Traitors and the like can also be revived with the previous role mostly intact. command_announcement.Announce("Ion storm detected near the [station_name()]. Please check all AI-controlled equipment for errors.", "Anomaly Alert", new_sound = 'sound/AI/ionstorm.ogg') feedback_add_details("admin_verb","IONC") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! -/client/proc/cmd_admin_rejuvenate(mob/living/M as mob in GLOB.mob_list) +/client/proc/cmd_admin_rejuvenate(mob/living/M as mob in SSmobs.mob_list) set category = "Special Verbs" set name = "Rejuvenate" if(!holder) @@ -599,7 +599,7 @@ Traitors and the like can also be revived with the previous role mostly intact. else return -/client/proc/cmd_admin_gib(mob/M as mob in GLOB.mob_list) +/client/proc/cmd_admin_gib(mob/M as mob in SSmobs.mob_list) set category = "Special Verbs" set name = "Gib" @@ -639,7 +639,7 @@ Traitors and the like can also be revived with the previous role mostly intact. // I will both remove their SVN access and permanently ban them from my servers. return -/client/proc/cmd_admin_check_contents(mob/living/M as mob in GLOB.mob_list) +/client/proc/cmd_admin_check_contents(mob/living/M as mob in SSmobs.mob_list) set category = "Special Verbs" set name = "Check Contents" @@ -747,7 +747,7 @@ Traitors and the like can also be revived with the previous role mostly intact. log_admin("[key_name(src)] has [evacuation_controller.deny ? "denied" : "allowed"] evacuation to be called.") message_admins("[key_name_admin(usr)] has [evacuation_controller.deny ? "denied" : "allowed"] evacuation to be called.") -/client/proc/cmd_admin_attack_log(mob/M as mob in GLOB.mob_list) +/client/proc/cmd_admin_attack_log(mob/M as mob in SSmobs.mob_list) set category = "Special Verbs" set name = "Attack Log" diff --git a/code/modules/alarm/alarm.dm b/code/modules/alarm/alarm.dm index 3c51623419fa1..5fcb1ef63e757 100644 --- a/code/modules/alarm/alarm.dm +++ b/code/modules/alarm/alarm.dm @@ -30,7 +30,7 @@ cameras() // Sets up both cameras and last alarm area. set_source_data(source, duration, severity) -/datum/alarm/proc/process() +/datum/alarm/Process() // Has origin gone missing? if(!origin && !end_time) end_time = world.time + ALARM_RESET_DELAY diff --git a/code/modules/alarm/alarm_handler.dm b/code/modules/alarm/alarm_handler.dm index 8042dabc03e3c..20b726d146aab 100644 --- a/code/modules/alarm/alarm_handler.dm +++ b/code/modules/alarm/alarm_handler.dm @@ -7,9 +7,9 @@ var/list/datum/alarm/alarms_assoc = new // Associative list of alarms, to efficiently acquire them based on origin. var/list/listeners = new // A list of all objects interested in alarm changes. -/datum/alarm_handler/proc/process() +/datum/alarm_handler/Process() for(var/datum/alarm/A in alarms) - A.process() + A.Process() check_alarm_cleared(A) /datum/alarm_handler/proc/triggerAlarm(var/atom/origin, var/atom/source, var/duration = 0, var/severity = 1) diff --git a/code/modules/assembly/holder.dm b/code/modules/assembly/holder.dm index d3b80559b4f06..87e90a6daaf3f 100644 --- a/code/modules/assembly/holder.dm +++ b/code/modules/assembly/holder.dm @@ -242,7 +242,7 @@ tmr.time=5 tmr.secured = 1 tmr.holder = src - GLOB.processing_objects.Add(tmr) + START_PROCESSING(SSobj, tmr) a_left = tmr a_right = ign secured = 1 @@ -297,7 +297,7 @@ var/obj/item/device/assembly/prox_sensor/prox = new(src) prox.secured = 1 prox.holder = src - GLOB.processing_objects.Add(prox) + START_PROCESSING(SSobj, prox) a_left = prox a_right = ign secured = 1 diff --git a/code/modules/assembly/proximity.dm b/code/modules/assembly/proximity.dm index f629d8320bd57..0f64cacbd5d83 100644 --- a/code/modules/assembly/proximity.dm +++ b/code/modules/assembly/proximity.dm @@ -29,11 +29,11 @@ /obj/item/device/assembly/prox_sensor/toggle_secure() secured = !secured if(secured) - GLOB.processing_objects.Add(src) + START_PROCESSING(SSobj, src) else scanning = 0 timing = 0 - GLOB.processing_objects.Remove(src) + STOP_PROCESSING(SSobj, src) update_icon() return secured @@ -61,7 +61,7 @@ return -/obj/item/device/assembly/prox_sensor/process() +/obj/item/device/assembly/prox_sensor/Process() if(scanning) var/turf/mainloc = get_turf(src) for(var/mob/living/A in range(range,mainloc)) diff --git a/code/modules/assembly/signaler.dm b/code/modules/assembly/signaler.dm index 1a13dd646f104..53df5af4d2be0 100644 --- a/code/modules/assembly/signaler.dm +++ b/code/modules/assembly/signaler.dm @@ -153,15 +153,15 @@ radio_connection = radio_controller.add_object(src, frequency, RADIO_CHAT) return -/obj/item/device/assembly/signaler/process() +/obj/item/device/assembly/signaler/Process() if(!deadman) - GLOB.processing_objects.Remove(src) + STOP_PROCESSING(SSobj, src) var/mob/M = src.loc if(!M || !ismob(M)) if(prob(5)) signal() deadman = 0 - GLOB.processing_objects.Remove(src) + STOP_PROCESSING(SSobj, src) else if(prob(5)) M.visible_message("[M]'s finger twitches a bit over [src]'s signal button!") return @@ -173,12 +173,12 @@ if(!deadman) deadman = 1 - GLOB.processing_objects.Add(src) + START_PROCESSING(SSobj, src) log_and_message_admins("is threatening to trigger a signaler deadman's switch") usr.visible_message("[usr] moves their finger over [src]'s signal button...") else deadman = 0 - GLOB.processing_objects.Remove(src) + STOP_PROCESSING(SSobj, src) log_and_message_admins("stops threatening to trigger a signaler deadman's switch") usr.visible_message("[usr] moves their finger away from [src]'s signal button.") diff --git a/code/modules/assembly/timer.dm b/code/modules/assembly/timer.dm index 4e72f68feab93..4193d91f563d5 100644 --- a/code/modules/assembly/timer.dm +++ b/code/modules/assembly/timer.dm @@ -27,10 +27,10 @@ /obj/item/device/assembly/timer/toggle_secure() secured = !secured if(secured) - GLOB.processing_objects.Add(src) + START_PROCESSING(SSobj, src) else timing = 0 - GLOB.processing_objects.Remove(src) + STOP_PROCESSING(SSobj, src) update_icon() return secured @@ -46,7 +46,7 @@ return -/obj/item/device/assembly/timer/process() +/obj/item/device/assembly/timer/Process() if(timing && (time > 0)) time-- if(timing && time <= 0) diff --git a/code/modules/atmospherics/atmospherics.dm b/code/modules/atmospherics/atmospherics.dm index a9888d8689fbc..5135b3a9452e0 100644 --- a/code/modules/atmospherics/atmospherics.dm +++ b/code/modules/atmospherics/atmospherics.dm @@ -101,7 +101,7 @@ obj/machinery/atmospherics/proc/check_connect_types(obj/machinery/atmospherics/a return node.pipe_color -/obj/machinery/atmospherics/process() +/obj/machinery/atmospherics/Process() last_flow_rate = 0 last_power_draw = 0 diff --git a/code/modules/atmospherics/components/binary_devices/circulator.dm b/code/modules/atmospherics/components/binary_devices/circulator.dm index f9d985ee4c9c4..860500c6aa92b 100644 --- a/code/modules/atmospherics/components/binary_devices/circulator.dm +++ b/code/modules/atmospherics/components/binary_devices/circulator.dm @@ -67,7 +67,7 @@ stored_energy = 0 return last_stored_energy_transferred -/obj/machinery/atmospherics/binary/circulator/process() +/obj/machinery/atmospherics/binary/circulator/Process() ..() if(last_worldtime_transfer < world.time - 50) diff --git a/code/modules/atmospherics/components/binary_devices/dp_vent_pump.dm b/code/modules/atmospherics/components/binary_devices/dp_vent_pump.dm index f1dc597283243..4121e4d1232b8 100644 --- a/code/modules/atmospherics/components/binary_devices/dp_vent_pump.dm +++ b/code/modules/atmospherics/components/binary_devices/dp_vent_pump.dm @@ -99,7 +99,7 @@ update_icon() update_underlays() -/obj/machinery/atmospherics/binary/dp_vent_pump/process() +/obj/machinery/atmospherics/binary/dp_vent_pump/Process() ..() last_power_draw = 0 diff --git a/code/modules/atmospherics/components/binary_devices/passive_gate.dm b/code/modules/atmospherics/components/binary_devices/passive_gate.dm index b29d2a108177f..91bf6108711ae 100644 --- a/code/modules/atmospherics/components/binary_devices/passive_gate.dm +++ b/code/modules/atmospherics/components/binary_devices/passive_gate.dm @@ -48,7 +48,7 @@ /obj/machinery/atmospherics/binary/passive_gate/hide(var/i) update_underlays() -/obj/machinery/atmospherics/binary/passive_gate/process() +/obj/machinery/atmospherics/binary/passive_gate/Process() ..() last_flow_rate = 0 diff --git a/code/modules/atmospherics/components/omni_devices/omni_base.dm b/code/modules/atmospherics/components/omni_devices/omni_base.dm index 8f60548fd0fbb..d074443475553 100644 --- a/code/modules/atmospherics/components/omni_devices/omni_base.dm +++ b/code/modules/atmospherics/components/omni_devices/omni_base.dm @@ -61,7 +61,7 @@ /obj/machinery/atmospherics/omni/proc/error_check() return -/obj/machinery/atmospherics/omni/process() +/obj/machinery/atmospherics/omni/Process() last_power_draw = 0 last_flow_rate = 0 diff --git a/code/modules/atmospherics/components/trinary_devices/filter.dm b/code/modules/atmospherics/components/trinary_devices/filter.dm index d595dd4529684..15b0272f90d77 100755 --- a/code/modules/atmospherics/components/trinary_devices/filter.dm +++ b/code/modules/atmospherics/components/trinary_devices/filter.dm @@ -87,7 +87,7 @@ /obj/machinery/atmospherics/trinary/filter/hide(var/i) update_underlays() -/obj/machinery/atmospherics/trinary/filter/process() +/obj/machinery/atmospherics/trinary/filter/Process() ..() last_power_draw = 0 @@ -246,7 +246,7 @@ obj/machinery/atmospherics/trinary/filter/m_filter/New() /obj/machinery/atmospherics/trinary/filter/m_filter/Initialize() . = ..() set_frequency(frequency) - + /obj/machinery/atmospherics/trinary/filter/m_filter/atmos_init() ..() diff --git a/code/modules/atmospherics/components/trinary_devices/mixer.dm b/code/modules/atmospherics/components/trinary_devices/mixer.dm index b8bc24996a093..f5a4457740d7c 100644 --- a/code/modules/atmospherics/components/trinary_devices/mixer.dm +++ b/code/modules/atmospherics/components/trinary_devices/mixer.dm @@ -66,7 +66,7 @@ if (!mixing_inputs) mixing_inputs = list(src.air1 = node1_concentration, src.air2 = node2_concentration) -/obj/machinery/atmospherics/trinary/mixer/process() +/obj/machinery/atmospherics/trinary/mixer/Process() ..() last_power_draw = 0 diff --git a/code/modules/atmospherics/components/tvalve.dm b/code/modules/atmospherics/components/tvalve.dm index 48db7c813565b..fe70b54f87c79 100644 --- a/code/modules/atmospherics/components/tvalve.dm +++ b/code/modules/atmospherics/components/tvalve.dm @@ -179,7 +179,7 @@ else src.go_to_side() -/obj/machinery/atmospherics/tvalve/process() +/obj/machinery/atmospherics/tvalve/Process() ..() . = PROCESS_KILL //machines.Remove(src) diff --git a/code/modules/atmospherics/components/unary/cold_sink.dm b/code/modules/atmospherics/components/unary/cold_sink.dm index a8ec53fca9bc2..b7d673662001b 100644 --- a/code/modules/atmospherics/components/unary/cold_sink.dm +++ b/code/modules/atmospherics/components/unary/cold_sink.dm @@ -118,7 +118,7 @@ add_fingerprint(usr) -/obj/machinery/atmospherics/unary/freezer/process() +/obj/machinery/atmospherics/unary/freezer/Process() ..() if(stat & (NOPOWER|BROKEN) || !use_power) diff --git a/code/modules/atmospherics/components/unary/heat_source.dm b/code/modules/atmospherics/components/unary/heat_source.dm index b2db47d48c3fd..47440d489cc20 100644 --- a/code/modules/atmospherics/components/unary/heat_source.dm +++ b/code/modules/atmospherics/components/unary/heat_source.dm @@ -67,7 +67,7 @@ return -/obj/machinery/atmospherics/unary/heater/process() +/obj/machinery/atmospherics/unary/heater/Process() ..() if(stat & (NOPOWER|BROKEN) || !use_power) diff --git a/code/modules/atmospherics/components/unary/outlet_injector.dm b/code/modules/atmospherics/components/unary/outlet_injector.dm index 2d4aa99eed6d3..f9cf0de9643cd 100644 --- a/code/modules/atmospherics/components/unary/outlet_injector.dm +++ b/code/modules/atmospherics/components/unary/outlet_injector.dm @@ -1,4 +1,4 @@ -//Basically a one way passive valve. If the pressure inside is greater than the environment then gas will flow passively, +//Basically a one way passive valve. If the pressure inside is greater than the environment then gas will flow passively, //but it does not permit gas to flow back from the environment into the injector. Can be turned off to prevent any gas flow. //When it receives the "inject" signal, it will try to pump it's entire contents into the environment regardless of pressure, using power. @@ -12,7 +12,7 @@ use_power = 0 idle_power_usage = 150 //internal circuitry, friction losses and stuff power_rating = 15000 //15000 W ~ 20 HP - + var/injecting = 0 var/volume_rate = 50 //flow rate limit @@ -25,7 +25,7 @@ /obj/machinery/atmospherics/unary/outlet_injector/New() ..() - air_contents.volume = ATMOS_DEFAULT_VOLUME_PUMP + 500 //Give it a small reservoir for injecting. Also allows it to have a higher flow rate limit than vent pumps, to differentiate injectors a bit more. + air_contents.volume = ATMOS_DEFAULT_VOLUME_PUMP + 500 //Give it a small reservoir for injecting. Also allows it to have a higher flow rate limit than vent pumps, to differentiate injectors a bit more. /obj/machinery/atmospherics/unary/outlet_injector/update_icon() if(!powered()) @@ -41,7 +41,7 @@ return add_underlay(T, node, dir) -/obj/machinery/atmospherics/unary/outlet_injector/process() +/obj/machinery/atmospherics/unary/outlet_injector/Process() ..() last_power_draw = 0 @@ -49,21 +49,21 @@ if((stat & (NOPOWER|BROKEN)) || !use_power) return - + var/power_draw = -1 var/datum/gas_mixture/environment = loc.return_air() - + if(environment && air_contents.temperature > 0) var/transfer_moles = (volume_rate/air_contents.volume)*air_contents.total_moles //apply flow rate limit power_draw = pump_gas(src, air_contents, environment, transfer_moles, power_rating) - + if (power_draw >= 0) last_power_draw = power_draw use_power(power_draw) - + if(network) network.update = 1 - + return 1 /obj/machinery/atmospherics/unary/outlet_injector/proc/inject() @@ -73,7 +73,7 @@ var/datum/gas_mixture/environment = loc.return_air() if (!environment) return 0 - + injecting = 1 if(air_contents.temperature > 0) diff --git a/code/modules/atmospherics/components/unary/vent_scrubber.dm b/code/modules/atmospherics/components/unary/vent_scrubber.dm index d8b96773aa144..674c6f6256abd 100644 --- a/code/modules/atmospherics/components/unary/vent_scrubber.dm +++ b/code/modules/atmospherics/components/unary/vent_scrubber.dm @@ -137,7 +137,7 @@ if(g != "oxygen" && g != "nitrogen") scrubbing_gas += g -/obj/machinery/atmospherics/unary/vent_scrubber/process() +/obj/machinery/atmospherics/unary/vent_scrubber/Process() ..() if (hibernate > world.time) diff --git a/code/modules/atmospherics/datum_pipe_network.dm b/code/modules/atmospherics/datum_pipe_network.dm index 7e03f171b89cd..1cc95c7548e1c 100644 --- a/code/modules/atmospherics/datum_pipe_network.dm +++ b/code/modules/atmospherics/datum_pipe_network.dm @@ -27,7 +27,7 @@ //Give pipelines their process call for pressure checking and what not. Have to remove pressure checks for the time being as pipes dont radiate heat - Mport //for(var/datum/pipeline/line_member in line_members) - // line_member.process() + // line_member.Process() /datum/pipe_network/proc/build_network(obj/machinery/atmospherics/start_normal, obj/machinery/atmospherics/reference) //Purpose: Generate membership roster diff --git a/code/modules/atmospherics/datum_pipeline.dm b/code/modules/atmospherics/datum_pipeline.dm index 282866eb6c38e..f1efbd2818ed8 100644 --- a/code/modules/atmospherics/datum_pipeline.dm +++ b/code/modules/atmospherics/datum_pipeline.dm @@ -10,10 +10,10 @@ var/alert_pressure = 0 New() - GLOB.processing_objects += src + START_PROCESSING(SSobj, src) Destroy() - GLOB.processing_objects -= src + STOP_PROCESSING(SSobj, src) QDEL_NULL(network) if(air && air.volume) @@ -204,7 +204,7 @@ air.temperature -= heat/total_heat_capacity if(network) - network.update = 1 + network.update = 1 //surface must be the surface area in m^2 /datum/pipeline/proc/radiate_heat_to_space(surface, thermal_conductivity) diff --git a/code/modules/atmospherics/pipes.dm b/code/modules/atmospherics/pipes.dm index 515cbf8484044..65628186ddd30 100644 --- a/code/modules/atmospherics/pipes.dm +++ b/code/modules/atmospherics/pipes.dm @@ -189,7 +189,7 @@ invisibility = i ? 101 : 0 update_icon() -/obj/machinery/atmospherics/pipe/simple/process() +/obj/machinery/atmospherics/pipe/simple/Process() if(!parent) //This should cut back on the overhead calling build_network thousands of times per cycle ..() else if(leaking) @@ -279,7 +279,7 @@ overlays += icon_manager.get_atmos_icon("pipe", , pipe_color, "[pipe_icon]exposed[node1?1:0][node2?1:0][icon_connect_type]") if(!leaking) leaking = 1 - GLOB.processing_objects |= src + START_PROCESSING(SSobj, src) /obj/machinery/atmospherics/pipe/simple/update_underlays() return @@ -460,7 +460,7 @@ /obj/machinery/atmospherics/pipe/manifold/pipeline_expansion() return list(node1, node2, node3) -/obj/machinery/atmospherics/pipe/manifold/process() +/obj/machinery/atmospherics/pipe/manifold/Process() if(!parent) ..() else @@ -708,7 +708,7 @@ /obj/machinery/atmospherics/pipe/manifold4w/pipeline_expansion() return list(node1, node2, node3, node4) -/obj/machinery/atmospherics/pipe/manifold4w/process() +/obj/machinery/atmospherics/pipe/manifold4w/Process() if(!parent) ..() else @@ -975,7 +975,7 @@ /obj/machinery/atmospherics/pipe/cap/pipeline_expansion() return list(node) -/obj/machinery/atmospherics/pipe/cap/process() +/obj/machinery/atmospherics/pipe/cap/Process() if(!parent) ..() else @@ -1096,7 +1096,7 @@ initialize_directions = dir ..() -/obj/machinery/atmospherics/pipe/tank/process() +/obj/machinery/atmospherics/pipe/tank/Process() if(!parent) ..() else @@ -1261,7 +1261,7 @@ name = "Larger vent" volume = 1000 -/obj/machinery/atmospherics/pipe/vent/process() +/obj/machinery/atmospherics/pipe/vent/Process() if(!parent) if(build_killswitch <= 0) . = PROCESS_KILL diff --git a/code/modules/awaymissions/bluespaceartillery.dm b/code/modules/awaymissions/bluespaceartillery.dm index 8c2433333bc74..717a42579654d 100644 --- a/code/modules/awaymissions/bluespaceartillery.dm +++ b/code/modules/awaymissions/bluespaceartillery.dm @@ -7,7 +7,7 @@ density = 1 anchored = 1 -/obj/machinery/artillerycontrol/process() +/obj/machinery/artillerycontrol/Process() if(src.reload<180) src.reload++ diff --git a/code/modules/awaymissions/gateway.dm b/code/modules/awaymissions/gateway.dm index 511c875963102..f23ecd8904089 100644 --- a/code/modules/awaymissions/gateway.dm +++ b/code/modules/awaymissions/gateway.dm @@ -48,7 +48,7 @@ -obj/machinery/gateway/centerstation/process() +obj/machinery/gateway/centerstation/Process() if(stat & (NOPOWER)) if(active) toggleoff() return diff --git a/code/modules/blob/blob.dm b/code/modules/blob/blob.dm index 7f6b81dd14f3c..6390838bcc27c 100644 --- a/code/modules/blob/blob.dm +++ b/code/modules/blob/blob.dm @@ -188,14 +188,14 @@ icon_state = "blob_factory" /obj/effect/blob/core/New(loc) - GLOB.processing_objects.Add(src) + START_PROCESSING(SSobj, src) return ..(loc) /obj/effect/blob/core/Destroy() - GLOB.processing_objects.Remove(src) + STOP_PROCESSING(SSobj, src) return ..() -/obj/effect/blob/core/process() +/obj/effect/blob/core/Process() set waitfor = 0 if(!blob_may_process) return diff --git a/code/modules/clothing/head/misc_special.dm b/code/modules/clothing/head/misc_special.dm index 3362634a8e3b9..485fb1cb4baa3 100644 --- a/code/modules/clothing/head/misc_special.dm +++ b/code/modules/clothing/head/misc_special.dm @@ -115,9 +115,9 @@ var/onfire = 0 body_parts_covered = HEAD -/obj/item/clothing/head/cakehat/process() +/obj/item/clothing/head/cakehat/Process() if(!onfire) - GLOB.processing_objects.Remove(src) + STOP_PROCESSING(SSobj, src) return var/turf/location = src.loc @@ -136,7 +136,7 @@ src.damtype = "fire" src.icon_state = "cake1" src.item_state = "cake1" - GLOB.processing_objects.Add(src) + START_PROCESSING(SSobj, src) else src.force = null src.damtype = "brute" diff --git a/code/modules/clothing/spacesuits/rig/modules/combat.dm b/code/modules/clothing/spacesuits/rig/modules/combat.dm index 802eb998a838a..e1f7a9ea4e9f9 100644 --- a/code/modules/clothing/spacesuits/rig/modules/combat.dm +++ b/code/modules/clothing/spacesuits/rig/modules/combat.dm @@ -184,7 +184,7 @@ gun = /obj/item/weapon/gun/energy/crossbow/ninja -/obj/item/rig_module/mounted/energy_blade/process() +/obj/item/rig_module/mounted/energy_blade/Process() if(holder && holder.wearer) if(!(locate(/obj/item/weapon/melee/energy/blade) in holder.wearer)) diff --git a/code/modules/clothing/spacesuits/rig/modules/computer.dm b/code/modules/clothing/spacesuits/rig/modules/computer.dm index cc2506b5a8bd8..5c0bc7c711803 100644 --- a/code/modules/clothing/spacesuits/rig/modules/computer.dm +++ b/code/modules/clothing/spacesuits/rig/modules/computer.dm @@ -50,7 +50,7 @@ /mob var/get_rig_stats = 0 -/obj/item/rig_module/ai_container/process() +/obj/item/rig_module/ai_container/Process() if(integrated_ai) var/obj/item/weapon/rig/rig = get_rig() if(rig && rig.ai_override_enabled) @@ -423,7 +423,7 @@ return 1 return 0 -/obj/item/rig_module/power_sink/process() +/obj/item/rig_module/power_sink/Process() if(!interfaced_with) return ..() diff --git a/code/modules/clothing/spacesuits/rig/modules/modules.dm b/code/modules/clothing/spacesuits/rig/modules/modules.dm index a7582d793149a..085fc181a8789 100644 --- a/code/modules/clothing/spacesuits/rig/modules/modules.dm +++ b/code/modules/clothing/spacesuits/rig/modules/modules.dm @@ -216,7 +216,7 @@ return // Called by the hardsuit each rig process tick. -/obj/item/rig_module/process() +/obj/item/rig_module/Process() if(active) return active_power_cost else diff --git a/code/modules/clothing/spacesuits/rig/modules/ninja.dm b/code/modules/clothing/spacesuits/rig/modules/ninja.dm index 683e5e25a2ab3..34505985bd121 100644 --- a/code/modules/clothing/spacesuits/rig/modules/ninja.dm +++ b/code/modules/clothing/spacesuits/rig/modules/ninja.dm @@ -235,7 +235,7 @@ qdel(holder) qdel(src) -/obj/item/rig_module/self_destruct/process() +/obj/item/rig_module/self_destruct/Process() // Not being worn, leave it alone. if(!holder || !holder.wearer || !holder.wearer.wear_suit == holder) return 0 diff --git a/code/modules/clothing/spacesuits/rig/rig.dm b/code/modules/clothing/spacesuits/rig/rig.dm index 508f53f68fd65..06069e32b1f4e 100644 --- a/code/modules/clothing/spacesuits/rig/rig.dm +++ b/code/modules/clothing/spacesuits/rig/rig.dm @@ -119,7 +119,7 @@ spark_system.set_up(5, 0, src) spark_system.attach(src) - GLOB.processing_objects |= src + START_PROCESSING(SSobj, src) if(initial_modules && initial_modules.len) for(var/path in initial_modules) @@ -170,7 +170,7 @@ if(istype(M)) M.drop_from_inventory(piece) qdel(piece) - GLOB.processing_objects -= src + STOP_PROCESSING(SSobj, src) qdel(wires) wires = null qdel(spark_system) @@ -354,7 +354,7 @@ helmet.flags_inv |= HIDEMASK update_icon(1) -/obj/item/weapon/rig/process() +/obj/item/weapon/rig/Process() // If we've lost any parts, grab them back. var/mob/living/M @@ -402,7 +402,7 @@ malfunction() for(var/obj/item/rig_module/module in installed_modules) - cell.use(module.process() * CELLRATE) + cell.use(module.Process() * CELLRATE) //offline should not change outside this proc /obj/item/weapon/rig/proc/update_offline() diff --git a/code/modules/detectivework/microscope/dnascanner.dm b/code/modules/detectivework/microscope/dnascanner.dm index 792fcd521d1ed..1bf4750ad25c5 100644 --- a/code/modules/detectivework/microscope/dnascanner.dm +++ b/code/modules/detectivework/microscope/dnascanner.dm @@ -84,7 +84,7 @@ return 1 -/obj/machinery/dnaforensics/process() +/obj/machinery/dnaforensics/Process() if(scanning) if(!bloodsamp || bloodsamp.loc != src) bloodsamp = null diff --git a/code/modules/detectivework/tools/rag.dm b/code/modules/detectivework/tools/rag.dm index 7f95e312aa055..fd6dc9d7dc6c7 100644 --- a/code/modules/detectivework/tools/rag.dm +++ b/code/modules/detectivework/tools/rag.dm @@ -34,7 +34,7 @@ update_name() /obj/item/weapon/reagent_containers/glass/rag/Destroy() - GLOB.processing_objects -= src //so we don't continue turning to ash while gc'd + STOP_PROCESSING(SSobj, src) //so we don't continue turning to ash while gc'd . = ..() /obj/item/weapon/reagent_containers/glass/rag/attack_self(mob/user as mob) @@ -177,14 +177,14 @@ qdel(src) return - GLOB.processing_objects += src + START_PROCESSING(SSobj, src) set_light(2, null, "#E38F46") on_fire = 1 update_name() update_icon() /obj/item/weapon/reagent_containers/glass/rag/proc/extinguish() - GLOB.processing_objects -= src + STOP_PROCESSING(SSobj, src) set_light(0) on_fire = 0 @@ -197,7 +197,7 @@ update_name() update_icon() -/obj/item/weapon/reagent_containers/glass/rag/process() +/obj/item/weapon/reagent_containers/glass/rag/Process() if(!can_ignite()) visible_message("\The [src] burns out.") extinguish() @@ -211,7 +211,7 @@ location.hotspot_expose(700, 5) if(burn_time <= 0) - GLOB.processing_objects -= src + STOP_PROCESSING(SSobj, src) new /obj/effect/decal/cleanable/ash(location) qdel(src) return diff --git a/code/modules/detectivework/tools/uvlight.dm b/code/modules/detectivework/tools/uvlight.dm index 61aa96a02df8e..ec7540cdc1b63 100644 --- a/code/modules/detectivework/tools/uvlight.dm +++ b/code/modules/detectivework/tools/uvlight.dm @@ -21,12 +21,12 @@ on = !on if(on) set_light(range, 2, "#007fff") - GLOB.processing_objects |= src + START_PROCESSING(SSobj, src) icon_state = "uv_on" else set_light(0) clear_last_scan() - GLOB.processing_objects -= src + STOP_PROCESSING(SSobj, src) icon_state = "uv_off" /obj/item/device/uv_light/proc/clear_last_scan() @@ -46,7 +46,7 @@ if(I.fluorescent == 2) I.fluorescent = 1 reset_objects.Cut() -/obj/item/device/uv_light/process() +/obj/item/device/uv_light/Process() clear_last_scan() if(on) step_alpha = round(255/range) diff --git a/code/modules/economy/ATM.dm b/code/modules/economy/ATM.dm index 9641ab0ca8b27..b14eec96ddc16 100644 --- a/code/modules/economy/ATM.dm +++ b/code/modules/economy/ATM.dm @@ -34,7 +34,7 @@ spark_system.set_up(5, 0, src) spark_system.attach(src) -/obj/machinery/atm/process() +/obj/machinery/atm/Process() if(stat & NOPOWER) return diff --git a/code/modules/events/blob.dm b/code/modules/events/blob.dm index 29a027ce6237f..44f6439bd7fa3 100644 --- a/code/modules/events/blob.dm +++ b/code/modules/events/blob.dm @@ -16,7 +16,7 @@ log_and_message_admins("Blob spawned in \the [get_area(T)]", location = T) Blob = new /obj/effect/blob/core(T) for(var/i = 1; i < rand(3, 4), i++) - Blob.process() + Blob.Process() /datum/event/blob/tick() if(!Blob || !Blob.loc) @@ -24,4 +24,4 @@ kill() return if(IsMultiple(activeFor, 3)) - Blob.process() + Blob.Process() diff --git a/code/modules/events/brand_intelligence.dm b/code/modules/events/brand_intelligence.dm index 7ae3af52f3216..5f6a0b132717e 100644 --- a/code/modules/events/brand_intelligence.dm +++ b/code/modules/events/brand_intelligence.dm @@ -12,7 +12,7 @@ /datum/event/brand_intelligence/start() - for(var/obj/machinery/vending/V in GLOB.machines) + for(var/obj/machinery/vending/V in SSmachines.machinery) //if(isNotStationLevel(V.z)) continue vendingMachines.Add(V) diff --git a/code/modules/events/electrical_storm.dm b/code/modules/events/electrical_storm.dm index 876f5e311f7e0..77418c0bbf107 100644 --- a/code/modules/events/electrical_storm.dm +++ b/code/modules/events/electrical_storm.dm @@ -17,7 +17,7 @@ /datum/event/electrical_storm/start() ..() valid_apcs = list() - for(var/obj/machinery/power/apc/A in GLOB.machines) + for(var/obj/machinery/power/apc/A in SSmachines.machinery) //if(A.z in GLOB.using_map.station_levels) valid_apcs.Add(A) endWhen = (severity * 60) + startWhen diff --git a/code/modules/events/event.dm b/code/modules/events/event.dm index 1fe1b43b1148c..8ff0405961145 100644 --- a/code/modules/events/event.dm +++ b/code/modules/events/event.dm @@ -101,7 +101,7 @@ //Do not override this proc, instead use the appropiate procs. //This proc will handle the calls to the appropiate procs. -/datum/event/proc/process() +/datum/event/Process() if(activeFor > startWhen && activeFor < endWhen) tick() diff --git a/code/modules/events/event_container.dm b/code/modules/events/event_container.dm index fb2de6a8a6567..4d2dc5cc5cf84 100644 --- a/code/modules/events/event_container.dm +++ b/code/modules/events/event_container.dm @@ -21,7 +21,7 @@ var/global/list/severity_to_string = list(EVENT_LEVEL_MUNDANE = "Mundane", EVENT var/last_world_time = 0 -/datum/event_container/proc/process() +/datum/event_container/Process() if(!next_event_time) set_event_delay() diff --git a/code/modules/events/ion_storm.dm b/code/modules/events/ion_storm.dm index 558d93bae4723..07fea100dae52 100644 --- a/code/modules/events/ion_storm.dm +++ b/code/modules/events/ion_storm.dm @@ -8,7 +8,7 @@ endWhen = rand(500, 1500) /datum/event/ionstorm/announce() - for(var/mob/living/silicon/S in GLOB.mob_list) + for(var/mob/living/silicon/S in SSmobs.mob_list) if(is_drone(S) || !(isAI(S) || isrobot(S))) continue if(isrobot(S)) diff --git a/code/modules/events/meteors.dm b/code/modules/events/meteors.dm index 1d86aef5c2371..4009edca09449 100644 --- a/code/modules/events/meteors.dm +++ b/code/modules/events/meteors.dm @@ -27,7 +27,7 @@ /datum/event/meteor_wave/tick() // Begin sending the alarm signals to shield diffusers so the field is already regenerated (if it exists) by the time actual meteors start flying around. if(alarmWhen < activeFor) - for(var/obj/machinery/shield_diffuser/SD in GLOB.machines) + for(var/obj/machinery/shield_diffuser/SD in SSmachines.machinery) if(isStationLevel(SD.z)) SD.meteor_alarm(10) diff --git a/code/modules/food/replicator.dm b/code/modules/food/replicator.dm index a168f787ac631..bedbac3d8514d 100644 --- a/code/modules/food/replicator.dm +++ b/code/modules/food/replicator.dm @@ -142,7 +142,7 @@ if(world.time > make_time) start_making = 1 -/obj/machinery/food_replicator/process() +/obj/machinery/food_replicator/Process() if(queued_dishes && queued_dishes.len) if(start_making) //want to do this first so that the first dish won't instantly come out src.audible_message("\The [src] rumbles and vibrates.") diff --git a/code/modules/halo/NPC/npc_overmind.dm b/code/modules/halo/NPC/npc_overmind.dm index 1327f11a8744b..510796105b868 100644 --- a/code/modules/halo/NPC/npc_overmind.dm +++ b/code/modules/halo/NPC/npc_overmind.dm @@ -254,12 +254,12 @@ GLOBAL_DATUM(flood_overmind, /datum/npc_overmind/flood) taskpoints -= taskpoint qdel(taskpoint) -/datum/npc_overmind/proc/process() +/datum/npc_overmind/Process() prune_taskpoints() prune_trooplists() process_reports() if(overmind_active == 0) - GLOB.processing_objects -= src + STOP_PROCESSING(SSobj, src) /datum/npc_overmind/flood overmind_name = "Gravemind" @@ -289,7 +289,7 @@ GLOBAL_DATUM(flood_overmind, /datum/npc_overmind/flood) if(!GLOB.flood_overmind) GLOB.flood_overmind = new() controlling_overmind = GLOB.flood_overmind - GLOB.processing_objects |= GLOB.flood_overmind + START_PROCESSING(SSobj, GLOB.flood_overmind) GLOB.flood_overmind.overmind_active = 1 GLOB.flood_overmind.reports.Cut() //We're likely activating the overmind here. Cut all previous reports out, they're likely outdated. diff --git a/code/modules/halo/admin/start_flood_attack.dm b/code/modules/halo/admin/start_flood_attack.dm index ada652e8274af..c0a2c7b9e0884 100644 --- a/code/modules/halo/admin/start_flood_attack.dm +++ b/code/modules/halo/admin/start_flood_attack.dm @@ -41,10 +41,10 @@ /datum/flood_invasion/New() . = ..() - GLOB.processing_objects += src + START_PROCESSING(SSobj, src) /datum/flood_invasion/Destroy() - GLOB.processing_objects -= src + STOP_PROCESSING(SSobj, src) . = ..() /datum/flood_invasion/proc/do_attack() @@ -58,7 +58,7 @@ else new_proj.launch(pick(overmap_objs)) -/datum/flood_invasion/proc/process() +/datum/flood_invasion/Process() if(world.time > next_attack_at) do_attack() next_attack_at = world.time + FLOOD_INVASION_ATTACK_DELAY \ No newline at end of file diff --git a/code/modules/halo/antag_overrides/objectives.dm b/code/modules/halo/antag_overrides/objectives.dm index a31867338f940..6dc681bd365f4 100644 --- a/code/modules/halo/antag_overrides/objectives.dm +++ b/code/modules/halo/antag_overrides/objectives.dm @@ -231,7 +231,7 @@ datum/objective/steal return found_amount>=target_amount if("a functional AI") - for(var/mob/living/silicon/ai/ai in GLOB.mob_list) + for(var/mob/living/silicon/ai/ai in SSmobs.mob_list) if(ai.stat == DEAD) continue var/turf/T = get_turf(ai) diff --git a/code/modules/halo/clothing/jetpacks.dm b/code/modules/halo/clothing/jetpacks.dm index 084787f0f312d..2e11268324211 100644 --- a/code/modules/halo/clothing/jetpacks.dm +++ b/code/modules/halo/clothing/jetpacks.dm @@ -80,7 +80,7 @@ user.flight_ticks_remain = flight_ticks_curr user.flight_item = src user.take_flight(flight_ticks_curr,"[user.name][takeoff_msg]","[user.name][land_msg]") - GLOB.processing_objects -= src + STOP_PROCESSING(SSobj, src) update_icon(user) if(!flight_bar) flight_bar = new(user,flight_ticks_max,src) @@ -94,7 +94,7 @@ user.flight_item = null if(user.elevation > 0) user.take_flight(0,(output_msg ? "[user.name][takeoff_msg]" : null),(output_msg ? "[user.name][land_msg]" : null)) - GLOB.processing_objects += src + START_PROCESSING(SSobj, src) update_icon(user) /obj/item/flight_item/ui_action_click() @@ -112,11 +112,11 @@ else activate(usr) -/obj/item/flight_item/process() +/obj/item/flight_item/Process() flight_ticks_curr = min(flight_ticks_max, flight_ticks_curr + flight_ticks_regen) flight_bar.update(flight_ticks_curr) if(flight_ticks_curr == flight_ticks_max) - GLOB.processing_objects -= src + STOP_PROCESSING(SSobj, src) /obj/item/flight_item/bullfrog_pack name = "\improper Series 8 Single Operator Lift Apparatus" diff --git a/code/modules/halo/clothing/special_armour.dm b/code/modules/halo/clothing/special_armour.dm index 931f102a2e445..d85944efb1611 100644 --- a/code/modules/halo/clothing/special_armour.dm +++ b/code/modules/halo/clothing/special_armour.dm @@ -58,7 +58,7 @@ special.try_item_action() /obj/item/clothing/suit/armor/special/Destroy() - GLOB.processing_objects -= src + STOP_PROCESSING(SSobj, src) for(var/item in specials) qdel(item) . = ..() diff --git a/code/modules/halo/comms/machines/_overmap_comms.dm b/code/modules/halo/comms/machines/_overmap_comms.dm index 278d1eda213e1..f770c437bb000 100644 --- a/code/modules/halo/comms/machines/_overmap_comms.dm +++ b/code/modules/halo/comms/machines/_overmap_comms.dm @@ -53,7 +53,7 @@ emp_act() failure_timer = duration -/obj/machinery/overmap_comms/process() +/obj/machinery/overmap_comms/Process() . = ..() //slowly recover from EMP diff --git a/code/modules/halo/comms/telecomms_jammers.dm b/code/modules/halo/comms/telecomms_jammers.dm index bc6604e4a431e..c53dca5abc71c 100644 --- a/code/modules/halo/comms/telecomms_jammers.dm +++ b/code/modules/halo/comms/telecomms_jammers.dm @@ -49,12 +49,12 @@ toggle_active(user) to_chat(user,"You toggle [src] to [active ? "on":"off"]") -/obj/machinery/overmap_comms/jammer/process() +/obj/machinery/overmap_comms/jammer/Process() . = ..() if(jam_end_at && world.time > jam_end_at) toggle_active() visible_message("[src] begins to overheat...") - GLOB.processing_objects -= src + STOP_PROCESSING(SSobj, src) explosion(get_turf(src),-1,1,2,0) qdel(src) diff --git a/code/modules/halo/covenant/cycling_trader.dm b/code/modules/halo/covenant/cycling_trader.dm index 527d62fe7a00b..b44c5ad262063 100644 --- a/code/modules/halo/covenant/cycling_trader.dm +++ b/code/modules/halo/covenant/cycling_trader.dm @@ -14,10 +14,10 @@ /obj/effect/landmark/cycling_trader/New() . = ..() - GLOB.processing_objects.Add(src) + START_PROCESSING(SSobj, src) time_cycle_trader = world.time + trader_gap_max -/obj/effect/landmark/cycling_trader/process() +/obj/effect/landmark/cycling_trader/Process() if(world.time > time_cycle_trader) if(has_trader) trader_leave() diff --git a/code/modules/halo/covenant/invasion_bomb_respawner.dm b/code/modules/halo/covenant/invasion_bomb_respawner.dm index a57294f8bf210..8771c4a032bae 100644 --- a/code/modules/halo/covenant/invasion_bomb_respawner.dm +++ b/code/modules/halo/covenant/invasion_bomb_respawner.dm @@ -18,7 +18,7 @@ return INITIALIZE_HINT_LATELOAD /obj/structure/invasion_bombspawner/LateInitialize() - GLOB.processing_objects += src + START_PROCESSING(SSobj, src) stored_bomb = locate(bomb_type) in dview(7,get_turf(src)) if(stored_bomb) spawn_at = get_turf(stored_bomb) @@ -41,13 +41,13 @@ new /obj/effect/knightroll_tp (spawn_at) stored_bomb = new bomb_type (spawn_at) -/obj/structure/invasion_bombspawner/process() +/obj/structure/invasion_bombspawner/Process() var/datum/gm = ticker.mode if(gm) - GLOB.processing_objects -= src + STOP_PROCESSING(SSobj, src) if(!istype(gm,/datum/game_mode/outer_colonies)) forceMove(null) - GLOB.processing_objects -= src + STOP_PROCESSING(SSobj, src) qdel(src) /obj/structure/invasion_bombspawner/ex_act() diff --git a/code/modules/halo/covenant/invasion_scanner.dm b/code/modules/halo/covenant/invasion_scanner.dm index 6ae1ea2ac27f9..d3ef5c9e6e1df 100644 --- a/code/modules/halo/covenant/invasion_scanner.dm +++ b/code/modules/halo/covenant/invasion_scanner.dm @@ -13,7 +13,7 @@ /obj/structure/invasion_scanner/Initialize() . = ..() - GLOB.processing_objects += src + START_PROCESSING(SSobj, src) /obj/structure/invasion_scanner/ex_act(var/severity) explosive_hits -= (round(3/severity)) @@ -21,22 +21,22 @@ qdel(src) else if(regen_at == 0) - GLOB.processing_objects += src + START_PROCESSING(SSobj, src) regen_at = world.time + HIT_REGEN_TIME -/obj/structure/invasion_scanner/process() +/obj/structure/invasion_scanner/Process() if(gm) if(world.time >= regen_at) explosive_hits = initial(explosive_hits) regen_at = 0 - GLOB.processing_objects -= src + STOP_PROCESSING(SSobj, src) else gm = ticker.mode if(gm) if(!istype(gm,/datum/game_mode/outer_colonies)) gm = null forceMove(null) - GLOB.processing_objects -= src + STOP_PROCESSING(SSobj, src) qdel(src) /obj/structure/invasion_scanner/examine(var/mob/user) diff --git a/code/modules/halo/covenant/manufactory/item_manufactory.dm b/code/modules/halo/covenant/manufactory/item_manufactory.dm index 519b9de510209..6dcf4a3dbcefe 100644 --- a/code/modules/halo/covenant/manufactory/item_manufactory.dm +++ b/code/modules/halo/covenant/manufactory/item_manufactory.dm @@ -69,7 +69,7 @@ for(var/curtype in typesof(type_parent) - type_parent) add_design(new curtype()) -/obj/machinery/item_manufacturer/process() +/obj/machinery/item_manufacturer/Process() if(building_queue.len && anchored) //chat spam i know... this machine is meant to be loud and crude if(busy_noises.len) diff --git a/code/modules/halo/covenant/simple_mobs/overmind.dm b/code/modules/halo/covenant/simple_mobs/overmind.dm index d178a0b320acd..8c43f9aab403f 100644 --- a/code/modules/halo/covenant/simple_mobs/overmind.dm +++ b/code/modules/halo/covenant/simple_mobs/overmind.dm @@ -20,7 +20,7 @@ GLOBAL_DATUM(covenant_overmind, /datum/npc_overmind/covenant) if(!GLOB.covenant_overmind) GLOB.covenant_overmind = new() controlling_overmind = GLOB.covenant_overmind - GLOB.processing_objects |= GLOB.covenant_overmind + START_PROCESSING(SSobj, GLOB.covenant_overmind) GLOB.covenant_overmind.overmind_active = 1 GLOB.covenant_overmind.reports.Cut() //We're likely activating the overmind here. Cut all previous reports out, they're likely outdated. diff --git a/code/modules/halo/covenant/species/sangheili/organs.dm b/code/modules/halo/covenant/species/sangheili/organs.dm index 520b16d36dbb9..41acc4d31d358 100644 --- a/code/modules/halo/covenant/species/sangheili/organs.dm +++ b/code/modules/halo/covenant/species/sangheili/organs.dm @@ -10,7 +10,7 @@ max_damage = 45 var/useheart = 0 -/obj/item/organ/internal/heart_secondary/process() +/obj/item/organ/internal/heart_secondary/Process() if(is_broken()) return var/obj/item/organ/internal/heart = owner.internal_organs_by_name["heart"] diff --git a/code/modules/halo/covenant/structures_machines/energybarricade.dm b/code/modules/halo/covenant/structures_machines/energybarricade.dm index 4e7318b6be32a..8c05b2c660699 100644 --- a/code/modules/halo/covenant/structures_machines/energybarricade.dm +++ b/code/modules/halo/covenant/structures_machines/energybarricade.dm @@ -52,19 +52,19 @@ src.plane = ABOVE_HUMAN_PLANE icon_state = fail_state processing = 1 - GLOB.processing_objects.Add(src) + START_PROCESSING(SSobj, src) if(blocks_air) update_nearby_tiles(1) -/obj/structure/energybarricade/process() +/obj/structure/energybarricade/Process() if(world.time >= time_recharged) //come back to full after being dropped if(shield_health <= 0) shield_health = max_shield update_icon() processing = 0 - GLOB.processing_objects.Remove(src) + STOP_PROCESSING(SSobj, src) if(blocks_air) update_nearby_tiles() @@ -78,7 +78,7 @@ if(shield_health >= max_shield) shield_health = max_shield processing = 0 - GLOB.processing_objects.Remove(src) + STOP_PROCESSING(SSobj, src) /obj/structure/energybarricade/CanPass(atom/movable/A, turf/T, height=1.5, air_group = 0) //can mobs pass unhindered using advanced alien technology? @@ -129,7 +129,7 @@ //spend some time breaking down the shield if(do_after(user, recharge_time, src)) - GLOB.processing_objects.Remove(src) + STOP_PROCESSING(SSobj, src) var/atom/movable/A = new item_type(src.loc) qdel(src) user.visible_message("[user] finishes deactivating [src] and packs it for transport.") @@ -165,7 +165,7 @@ if(!processing) processing = 1 - GLOB.processing_objects.Add(src) + START_PROCESSING(SSobj, src) /obj/structure/energybarricade/update_icon() var/shield_ratio = shield_health/max_shield diff --git a/code/modules/halo/covenant/structures_machines/pillar_lift.dm b/code/modules/halo/covenant/structures_machines/pillar_lift.dm index 78fad9c902068..35cd8c34efc15 100644 --- a/code/modules/halo/covenant/structures_machines/pillar_lift.dm +++ b/code/modules/halo/covenant/structures_machines/pillar_lift.dm @@ -71,10 +71,10 @@ /turf/simulated/open/pillar_lift/attackby(obj/item/C as obj, mob/user as mob) return -/turf/simulated/open/pillar_lift/process() +/turf/simulated/open/pillar_lift/Process() . = 1 if(world.time >= time_finish_moving) - GLOB.processing_objects -= src + STOP_PROCESSING(SSobj, src) if(move_dir > 0) do_extend() else if(move_dir < 0) @@ -107,7 +107,7 @@ //check back later to finish the move move_dir = 1 - GLOB.processing_objects += src + START_PROCESSING(SSobj, src) time_finish_moving = world.time + move_timer . = 1 @@ -174,7 +174,7 @@ //check back later to finish the move move_dir = -1 - GLOB.processing_objects += src + START_PROCESSING(SSobj, src) time_finish_moving = world.time + move_timer . = 1 diff --git a/code/modules/halo/covenant/structures_machines/plasmabattery.dm b/code/modules/halo/covenant/structures_machines/plasmabattery.dm index d40d16e6d0ecb..6ac326efdf7a4 100644 --- a/code/modules/halo/covenant/structures_machines/plasmabattery.dm +++ b/code/modules/halo/covenant/structures_machines/plasmabattery.dm @@ -15,18 +15,18 @@ if(charge > 0) if(!draining) icon_state = "in_use" - GLOB.processing_objects |= src + START_PROCESSING(SSobj, src) draining = 1 else icon_state = "drained" . = 0 -/obj/structure/plasma_battery/process() +/obj/structure/plasma_battery/Process() if(world.time > last_use_time + 30) if(charge > 0) icon_state = "full" draining = 0 - GLOB.processing_objects -= src + STOP_PROCESSING(SSobj, src) /obj/structure/plasma_battery/examine(mob/user, var/distance = -1, var/infix = "", var/suffix = "") ..() diff --git a/code/modules/halo/covenant/structures_machines/repulsor_engine.dm b/code/modules/halo/covenant/structures_machines/repulsor_engine.dm index 5e4aa8a9071e2..a161e609e59c9 100644 --- a/code/modules/halo/covenant/structures_machines/repulsor_engine.dm +++ b/code/modules/halo/covenant/structures_machines/repulsor_engine.dm @@ -62,7 +62,7 @@ QDEL_NULL(controller) . = ..() -/obj/machinery/repulsor_engine/process() +/obj/machinery/repulsor_engine/Process() if(use_power == 2) if(world.time > last_burn + 30) use_power = 1 diff --git a/code/modules/halo/covenant/structures_machines/weapon_rack.dm b/code/modules/halo/covenant/structures_machines/weapon_rack.dm index 2c0ddb045b719..1e7488146c497 100644 --- a/code/modules/halo/covenant/structures_machines/weapon_rack.dm +++ b/code/modules/halo/covenant/structures_machines/weapon_rack.dm @@ -38,7 +38,7 @@ charging_items.Add(I) if(!charging) charging = 1 - GLOB.processing_objects.Add(src) + START_PROCESSING(SSobj, src) return 1 else to_chat(user, "You can't fit \icon[I] onto [src].") @@ -73,7 +73,7 @@ else held_items -= I -/obj/structure/weapon_rack/process() +/obj/structure/weapon_rack/Process() for(var/obj/item/I in charging_items) if(I.loc != src.loc) charging_items -= I @@ -83,4 +83,4 @@ if(!charging_items.len) charging = 0 - GLOB.processing_objects.Remove(src) + STOP_PROCESSING(SSobj, src) diff --git a/code/modules/halo/demolitions/demolition_manager.dm b/code/modules/halo/demolitions/demolition_manager.dm index 7b983d8f1fce4..623ce39a25a9d 100644 --- a/code/modules/halo/demolitions/demolition_manager.dm +++ b/code/modules/halo/demolitions/demolition_manager.dm @@ -148,7 +148,7 @@ GLOBAL_LIST_INIT(DEMOLITION_MANAGER_LIST, new) to_chat(get_mobs_inside(), S) -/datum/demolition_manager/proc/process() +/datum/demolition_manager/Process() if(!structural_turfs.len) set_processing(0) do_demolition() @@ -182,9 +182,9 @@ GLOBAL_LIST_INIT(DEMOLITION_MANAGER_LIST, new) if(do_process) if(!is_processing) is_processing = 1 - GLOB.processing_objects += src + START_PROCESSING(SSobj, src) time_last_process = world.time else if(is_processing) is_processing = 0 - GLOB.processing_objects -= src + STOP_PROCESSING(SSobj, src) diff --git a/code/modules/halo/demolitions/pinpointer.dm b/code/modules/halo/demolitions/pinpointer.dm index b299902179e7a..7a89a34d76e03 100644 --- a/code/modules/halo/demolitions/pinpointer.dm +++ b/code/modules/halo/demolitions/pinpointer.dm @@ -5,18 +5,18 @@ var/wall_index = 0 var/checks_per_tick = 2 -/obj/item/weapon/pinpointer/demolition/process() +/obj/item/weapon/pinpointer/demolition/Process() workdisk(checks_per_tick) if(!active) - GLOB.processing_objects -= src + STOP_PROCESSING(SSobj, src) /obj/item/weapon/pinpointer/demolition/attack_self() . = ..() if(active) - GLOB.processing_objects += src + START_PROCESSING(SSobj, src) else - GLOB.processing_objects -= src + STOP_PROCESSING(SSobj, src) /obj/item/weapon/pinpointer/demolition/workdisk(var/max_checks = 99) if(!active) diff --git a/code/modules/halo/factions/_controller.dm b/code/modules/halo/factions/_controller.dm index 57ff21f30e827..7ca38a2c26135 100644 --- a/code/modules/halo/factions/_controller.dm +++ b/code/modules/halo/factions/_controller.dm @@ -48,5 +48,5 @@ /datum/controller/process/factions/doWork() for(var/datum/faction/F in processing_factions) - F.process() + F.Process() diff --git a/code/modules/halo/factions/objectives/_objectives.dm b/code/modules/halo/factions/objectives/_objectives.dm index dbc7e38001d34..f9bd8ae69a937 100644 --- a/code/modules/halo/factions/objectives/_objectives.dm +++ b/code/modules/halo/factions/objectives/_objectives.dm @@ -48,7 +48,7 @@ if(trigger_faction == my_faction.name) controlled_nodes |= C - GLOB.processing_objects |= src + START_PROCESSING(SSobj, src) GLOB.global_announcer.autosay("We have captured [C][old_faction ? " from the [old_faction]" : ""]!", radio_name, my_faction.default_radio_channel, radio_language) else if(old_faction == my_faction.name) @@ -59,10 +59,10 @@ if(old_faction == my_faction.name) controlled_nodes -= C if(!controlled_nodes.len) - GLOB.processing_objects -= src + STOP_PROCESSING(SSobj, src) GLOB.global_announcer.autosay("We have lost control of [C][trigger_faction ? " to the [trigger_faction]" : ""]!", radio_name, my_faction.default_radio_channel, radio_language) -/datum/objective/colony_capture/proc/process() +/datum/objective/colony_capture/Process() capture_score += score_per_tick * controlled_nodes.len /datum/objective/colony_capture/get_win_points() diff --git a/code/modules/halo/factions/process.dm b/code/modules/halo/factions/process.dm index 4f6e442345542..71f6cbfd5fcb3 100644 --- a/code/modules/halo/factions/process.dm +++ b/code/modules/halo/factions/process.dm @@ -4,7 +4,7 @@ GLOB.factions_controller.processing_factions.Add(src) is_processing = 1 -/datum/faction/proc/process() +/datum/faction/Process() //only do a process tick if we need to var/keep_processing = 0 @@ -29,7 +29,7 @@ //quests need processing sometimes if(processing_quests.len) for(var/datum/npc_quest/Q in processing_quests) - if(Q.process() != PROCESS_KILL) + if(Q.Process() != PROCESS_KILL) //assume the quest has already been removed from processing_quests elsewhere if PROCESS_KILL is returned keep_processing = 1 diff --git a/code/modules/halo/factions/quest/process.dm b/code/modules/halo/factions/quest/process.dm index 6d12b46afc968..9329863da46cd 100644 --- a/code/modules/halo/factions/quest/process.dm +++ b/code/modules/halo/factions/quest/process.dm @@ -5,7 +5,7 @@ var/respawn_interval = 4 SECONDS var/time_next_respawn = 0 -/datum/npc_quest/proc/process() +/datum/npc_quest/Process() if(quest_status != STATUS_PROGRESS) //future todo: sometimes quests might have ticking effects as long as they are available //for now, just tell the faction we dont need to process any more diff --git a/code/modules/halo/flood/flood_spawn.dm b/code/modules/halo/flood/flood_spawn.dm index 4795cd8bfb89d..61a4a54b8e586 100644 --- a/code/modules/halo/flood/flood_spawn.dm +++ b/code/modules/halo/flood/flood_spawn.dm @@ -34,9 +34,9 @@ return spawning = 1 - GLOB.processing_objects.Add(src) + START_PROCESSING(SSobj, src) -/datum/flood_spawner/proc/process() +/datum/flood_spawner/Process() if(world.time > time_next_respawn) time_next_respawn = world.time + respawn_delay if(live_flood.len < max_flood) @@ -50,7 +50,7 @@ if(!spawn_flood()) qdel(src) else - GLOB.processing_objects.Remove(src) + STOP_PROCESSING(SSobj, src) spawning = 0 //this is probably superfluous, but leave it here just in case @@ -90,12 +90,12 @@ live_flood -= F if(!spawning) spawning = 1 - GLOB.processing_objects.Add(src) + START_PROCESSING(SSobj, src) time_next_respawn = world.time + respawn_delay /datum/flood_spawner/Destroy() if(spawning) - GLOB.processing_objects.Remove(src) + STOP_PROCESSING(SSobj, src) if(hasvar(owner, "flood_spawner")) owner:flood_spawner = null . = ..() diff --git a/code/modules/halo/flood/flood_spawn_proxy.dm b/code/modules/halo/flood/flood_spawn_proxy.dm index 30fdd755c06b0..f27dd31351500 100644 --- a/code/modules/halo/flood/flood_spawn_proxy.dm +++ b/code/modules/halo/flood/flood_spawn_proxy.dm @@ -51,9 +51,9 @@ else if(istype(AM, /mob/living/carbon/human)) timer = world.time + time_to_spawn //starts the countdown uses-- - GLOB.processing_objects |= src + START_PROCESSING(SSobj, src) -/obj/structure/floodspawner/process() +/obj/structure/floodspawner/Process() if(timer != 0 && world.time > timer) timer_end() return @@ -64,6 +64,6 @@ src.loc.visible_message("A swarm of monsters bursts from a nearby air vent!") for(var/i = 0 to 8) new /mob/living/simple_animal/hostile/flood/infestor(dest) - GLOB.processing_objects.Remove(src) //removes from global list + STOP_PROCESSING(SSobj, src) //removes from global list if(uses <= 0) //redundant < in case of a use failure or bug qdel(src) //deletes after it runs out of uses \ No newline at end of file diff --git a/code/modules/halo/flood/types/infestor.dm b/code/modules/halo/flood/types/infestor.dm index 9ae936dcb2025..31895c6274f7d 100644 --- a/code/modules/halo/flood/types/infestor.dm +++ b/code/modules/halo/flood/types/infestor.dm @@ -138,7 +138,7 @@ melee_damage_lower = min(swarm_size, 30) melee_damage_upper = min(swarm_size * 5, 50) // - GLOB.mob_list -= AM + SSmobs.mob_list -= AM GLOB.live_flood_simplemobs -= AM if(AM:our_overmind) AM:our_overmind.combat_troops -= AM diff --git a/code/modules/halo/forerunner/sentinel_spawner.dm b/code/modules/halo/forerunner/sentinel_spawner.dm index 6bbfb9f636280..8a308ccc9767f 100644 --- a/code/modules/halo/forerunner/sentinel_spawner.dm +++ b/code/modules/halo/forerunner/sentinel_spawner.dm @@ -14,9 +14,9 @@ /obj/structure/sentinel_spawner/New() . = ..() - GLOB.processing_objects.Add(src) + START_PROCESSING(SSobj, src) -/obj/structure/sentinel_spawner/process() +/obj/structure/sentinel_spawner/Process() if(all_sentinels.len < max_sentinels) if(world.time > next_sentinel_spawn) spawn_sentinel() diff --git a/code/modules/halo/forerunner/species/knight/knight.dm b/code/modules/halo/forerunner/species/knight/knight.dm index 5f5fa5ab1f59f..329dacf1b06a9 100644 --- a/code/modules/halo/forerunner/species/knight/knight.dm +++ b/code/modules/halo/forerunner/species/knight/knight.dm @@ -128,9 +128,9 @@ /obj/effect/knightroll_tp/Initialize() . = ..() die_at = world.time + KNIGHT_TELEPORT_ANIM_TIME - GLOB.processing_objects += src + START_PROCESSING(SSobj, src) -/obj/effect/knightroll_tp/process() +/obj/effect/knightroll_tp/Process() if(world.time >= die_at) qdel(src) return diff --git a/code/modules/halo/leader_support/supply_drop_evac.dm b/code/modules/halo/leader_support/supply_drop_evac.dm index 83110099c3567..c446d2259b962 100644 --- a/code/modules/halo/leader_support/supply_drop_evac.dm +++ b/code/modules/halo/leader_support/supply_drop_evac.dm @@ -40,7 +40,7 @@ /obj/effect/evac_area/proc/set_evac_time(var/time) evac_end_at = world.time + time - GLOB.processing_objects += src + START_PROCESSING(SSobj, src) /obj/effect/evac_area/proc/set_evac_to(var/to_spot) evac_to = to_spot @@ -50,7 +50,7 @@ return to_evac.forceMove(evac_to) -/obj/effect/evac_area/process() +/obj/effect/evac_area/Process() if(world.time > evac_end_at) qdel(src) diff --git a/code/modules/halo/machinery/atmos_blastdoor.dm b/code/modules/halo/machinery/atmos_blastdoor.dm index d69a38080a4a7..18112d32d59dc 100644 --- a/code/modules/halo/machinery/atmos_blastdoor.dm +++ b/code/modules/halo/machinery/atmos_blastdoor.dm @@ -5,13 +5,13 @@ /obj/machinery/door/blast/atmos_close/New() . = ..() - GLOB.processing_objects += src + START_PROCESSING(SSobj, src) /obj/machinery/door/blast/atmos_close/Destroy() . = ..() - GLOB.processing_objects -= src + STOP_PROCESSING(SSobj, src) -/obj/machinery/door/blast/atmos_close/process() +/obj/machinery/door/blast/atmos_close/Process() . = ..() if(icon_state == icon_state_closed) return diff --git a/code/modules/halo/machinery/autosurgeon/process.dm b/code/modules/halo/machinery/autosurgeon/process.dm index 1596dceac53ee..0cf68ab7ab1f2 100644 --- a/code/modules/halo/machinery/autosurgeon/process.dm +++ b/code/modules/halo/machinery/autosurgeon/process.dm @@ -1,5 +1,5 @@ -/obj/machinery/autosurgeon/process() +/obj/machinery/autosurgeon/Process() if(active) if(world.time >= next_autosurgeon_action) next_autosurgeon_action = world.time + autosurgeon_action_delay diff --git a/code/modules/halo/machinery/boarding_beacon_launcher.dm b/code/modules/halo/machinery/boarding_beacon_launcher.dm index 12734415b683d..a4ace265cbe72 100644 --- a/code/modules/halo/machinery/boarding_beacon_launcher.dm +++ b/code/modules/halo/machinery/boarding_beacon_launcher.dm @@ -57,18 +57,18 @@ destroy_at = -1 return destroy_at = world.time + BOARDING_BEACON_DESTROYDELAY - GLOB.processing_objects += src + START_PROCESSING(SSobj, src) . = ..() -/obj/structure/boarding_beacon/process() +/obj/structure/boarding_beacon/Process() if(isnull(drop_point_created)) drop_point_created = new /obj/effect/landmark/drop_pod_landing (loc) drop_point_created.loc = loc drop_point_created.name = "Boarding Beacon" if(destroy_at == -1) - GLOB.processing_objects -= src + STOP_PROCESSING(SSobj, src) return if(world.time >= destroy_at) - GLOB.processing_objects -= src + STOP_PROCESSING(SSobj, src) qdel(drop_point_created) qdel(src) diff --git a/code/modules/halo/machinery/buttons/alertbutton.dm b/code/modules/halo/machinery/buttons/alertbutton.dm index 3eacd0d3b9812..7dfe9b365529f 100644 --- a/code/modules/halo/machinery/buttons/alertbutton.dm +++ b/code/modules/halo/machinery/buttons/alertbutton.dm @@ -45,7 +45,7 @@ else currently_alarming = 0 //Then, switch all lights to ominous red. - for(var/obj/machinery/light/l in GLOB.machines) + for(var/obj/machinery/light/l in SSmachines.machinery) if(!istype(l.loc.loc,area_base)) continue if(on) diff --git a/code/modules/halo/machinery/medical/thermopod.dm b/code/modules/halo/machinery/medical/thermopod.dm index a86576162dd77..905be77eea4d0 100644 --- a/code/modules/halo/machinery/medical/thermopod.dm +++ b/code/modules/halo/machinery/medical/thermopod.dm @@ -23,7 +23,7 @@ . = ..() update_icon() -/obj/machinery/thermopod/process() +/obj/machinery/thermopod/Process() if(stat & (NOPOWER|BROKEN)) return diff --git a/code/modules/halo/machinery/unsc_plasma_charger.dm b/code/modules/halo/machinery/unsc_plasma_charger.dm index c6f53db7c5ca4..efee093f12d71 100644 --- a/code/modules/halo/machinery/unsc_plasma_charger.dm +++ b/code/modules/halo/machinery/unsc_plasma_charger.dm @@ -17,7 +17,7 @@ power_channel = EQUIP var/obj/item/unsc_plasma_cell/charging = null -/obj/machinery/unsc_plasma_charger/process() +/obj/machinery/unsc_plasma_charger/Process() // log_debug("ccpt [charging] [stat]") if((stat & (BROKEN|NOPOWER)) || !anchored) diff --git a/code/modules/halo/misc/Fire_simple.dm b/code/modules/halo/misc/Fire_simple.dm index 76e224b06d8b9..7185c739654e6 100644 --- a/code/modules/halo/misc/Fire_simple.dm +++ b/code/modules/halo/misc/Fire_simple.dm @@ -23,7 +23,7 @@ set_dir(pick(GLOB.cardinal)) set_light(3, 1, light_color) firelevel = fl - GLOB.processing_objects.Add(src) + START_PROCESSING(SSobj, src) //ignite all the fuel for(var/obj/effect/decal/cleanable/liquid_fuel/fuel in src.loc) @@ -41,7 +41,7 @@ var/temperature = max(4000*sqrt(firelevel/vsc.fire_firelevel_multiplier), env_temperature) return heat2color(temperature) -/obj/effect/fire/process() +/obj/effect/fire/Process() . = 1 var/turf/simulated/my_tile = get_turf(loc) @@ -125,7 +125,7 @@ var/turf/T = loc if (istype(T)) set_light(0) - GLOB.processing_objects.Remove(src) + STOP_PROCESSING(SSobj, src) . = ..() diff --git a/code/modules/halo/misc/armourspecials/armourspecials.dm b/code/modules/halo/misc/armourspecials/armourspecials.dm index ffb8aac0673ed..d954980d48fe5 100644 --- a/code/modules/halo/misc/armourspecials/armourspecials.dm +++ b/code/modules/halo/misc/armourspecials/armourspecials.dm @@ -14,6 +14,6 @@ /datum/armourspecials/proc/on_drop(var/obj/source_armour) -/datum/armourspecials/proc/process() +/datum/armourspecials/Process() /datum/armourspecials/proc/update_mob_overlay(var/image/generated_overlay) \ No newline at end of file diff --git a/code/modules/halo/misc/armourspecials/cloaking_limited.dm b/code/modules/halo/misc/armourspecials/cloaking_limited.dm index 85b0bf26ec51a..a1838302a2eed 100644 --- a/code/modules/halo/misc/armourspecials/cloaking_limited.dm +++ b/code/modules/halo/misc/armourspecials/cloaking_limited.dm @@ -12,7 +12,7 @@ /datum/armourspecials/cloaking/limited/activate_cloak(var/voluntary = 1) if(current_charge >= max_charge * 0.25) last_process_time = world.time - GLOB.processing_objects |= src + START_PROCESSING(SSobj, src) to_chat(usr,"Current cloak charge: [100*current_charge/max_charge]%.") return ..() else @@ -22,7 +22,7 @@ . = ..() to_chat(usr,"Current cloak charge: [100*current_charge/max_charge]%.") -/datum/armourspecials/cloaking/limited/process() +/datum/armourspecials/cloaking/limited/Process() //grab delta time var/delta_time = world.time - last_process_time last_process_time = world.time @@ -46,7 +46,7 @@ //finished charging if(current_charge >= max_charge) current_charge = max_charge - GLOB.processing_objects -= src + STOP_PROCESSING(SSobj, src) to_chat(usr,"Current cloak charge: [100*current_charge/max_charge]%.") /datum/armourspecials/cloaking/limited/tryemp(severity) diff --git a/code/modules/halo/misc/armourspecials/holo_decoy.dm b/code/modules/halo/misc/armourspecials/holo_decoy.dm index 9f72db4c893f7..adcc74ea3fea0 100644 --- a/code/modules/halo/misc/armourspecials/holo_decoy.dm +++ b/code/modules/halo/misc/armourspecials/holo_decoy.dm @@ -41,7 +41,7 @@ if(world.time >= time_off_cooldown) to_chat(user, "You active the hologram decoy emitter contained in your [source_item].") - GLOB.processing_objects.Add(src) + START_PROCESSING(SSobj, src) time_off_cooldown = world.time + cooldown time_off_active = world.time + duration @@ -76,9 +76,9 @@ else to_chat(user, "Your [source_item] is on cooldown for another [(time_off_cooldown - world.time) / 10] seconds.") -/datum/armourspecials/holo_decoy/process() +/datum/armourspecials/holo_decoy/Process() if(world.time >= time_off_active) - GLOB.processing_objects -= src + STOP_PROCESSING(SSobj, src) if(decoy_holo) qdel(decoy_holo) diff --git a/code/modules/halo/misc/armourspecials/regeneration.dm b/code/modules/halo/misc/armourspecials/regeneration.dm index c3abe0e5dc1ec..07bc78d40c4a7 100644 --- a/code/modules/halo/misc/armourspecials/regeneration.dm +++ b/code/modules/halo/misc/armourspecials/regeneration.dm @@ -17,13 +17,13 @@ /datum/armourspecials/regeneration/on_equip(var/obj/source_armour) worn = source_armour owner = source_armour.loc - GLOB.processing_objects += src + START_PROCESSING(SSobj, src) /datum/armourspecials/regeneration/on_drop(var/obj/source_armour) owner = null - GLOB.processing_objects -= src + STOP_PROCESSING(SSobj, src) -/datum/armourspecials/regeneration/process() +/datum/armourspecials/regeneration/Process() if(active) heal_tick() else if(world.time >= next_active_time) diff --git a/code/modules/halo/misc/armourspecials/shields.dm b/code/modules/halo/misc/armourspecials/shields.dm index 2fbd487e0a2a5..2c88a2adb7db6 100644 --- a/code/modules/halo/misc/armourspecials/shields.dm +++ b/code/modules/halo/misc/armourspecials/shields.dm @@ -210,7 +210,7 @@ /datum/armourspecials/shields/proc/reset_recharge(var/extra_delay = 0) //begin counting down the recharge if(armour_state == SHIELD_IDLE) - GLOB.processing_objects |= src + START_PROCESSING(SSobj, src) //update the shield effect overlay if(shieldstrength > 0) @@ -221,7 +221,7 @@ armour_state = SHIELD_PROCESS nextcharge = world.time + shield_recharge_delay + extra_delay -/datum/armourspecials/shields/process() +/datum/armourspecials/shields/Process() //reset the shield visual if(armour_state == SHIELD_DAMAGE) @@ -256,7 +256,7 @@ if(shieldstrength >= totalshields) shieldstrength = totalshields armour_state = SHIELD_IDLE - GLOB.processing_objects -= src + STOP_PROCESSING(SSobj, src) update_overlay("shield_overlay") user.update_icons() diff --git a/code/modules/halo/misc/capture_node.dm b/code/modules/halo/misc/capture_node.dm index 7fa62e9e0b950..1cba73576671f 100644 --- a/code/modules/halo/misc/capture_node.dm +++ b/code/modules/halo/misc/capture_node.dm @@ -106,7 +106,7 @@ GLOBAL_LIST_EMPTY(capture_nodes) to_chat(user,"\icon[src] Your faction has no interest in controlling [src].") return -/obj/machinery/computer/capture_node/process() +/obj/machinery/computer/capture_node/Process() if(objective_secured && obsec_until > 0 && world.time > obsec_until) objective_secured = 0 obsec_until = 0 @@ -234,7 +234,7 @@ GLOBAL_LIST_EMPTY(capture_nodes) vis_flags = VIS_HIDE /obj/structure/capture_marker/proc/set_owner(var/new_faction) - GLOB.processing_objects.Remove(src) + STOP_PROCESSING(SSobj, src) if(new_faction) set_logo_alpha(255) else @@ -248,7 +248,7 @@ GLOBAL_LIST_EMPTY(capture_nodes) name = initial(name) /obj/structure/capture_marker/proc/reset_control() - GLOB.processing_objects.Remove(src) + STOP_PROCESSING(SSobj, src) if(control_faction) set_logo_alpha(255) else @@ -259,9 +259,9 @@ GLOBAL_LIST_EMPTY(capture_nodes) if(!control_faction) faction_logo = image(src.icon,src,trigger_faction) set_logo_alpha(fade_alpha1) - GLOB.processing_objects |= src + START_PROCESSING(SSobj, src) -/obj/structure/capture_marker/process() +/obj/structure/capture_marker/Process() if(control_faction) if(faction_logo.alpha == 255) set_logo_alpha(fade_alpha1) diff --git a/code/modules/halo/misc/fakewall.dm b/code/modules/halo/misc/fakewall.dm index 8430f9215b83b..09ae69fcb42cb 100644 --- a/code/modules/halo/misc/fakewall.dm +++ b/code/modules/halo/misc/fakewall.dm @@ -23,9 +23,9 @@ /turf/simulated/floor/plating/fakewall/New() . = ..() revert_time = world.time + open_duration - GLOB.processing_objects.Add(src) + START_PROCESSING(SSobj, src) -/turf/simulated/floor/plating/fakewall/process() +/turf/simulated/floor/plating/fakewall/Process() if(world.time >= revert_time) src.visible_message("[src] slides forward to hide its contents.") for(var/obj/machinery/light/S in get_step(src,dir)) diff --git a/code/modules/halo/misc/flaming_torch.dm b/code/modules/halo/misc/flaming_torch.dm index 1b0bea91ae552..821e9eff73e04 100644 --- a/code/modules/halo/misc/flaming_torch.dm +++ b/code/modules/halo/misc/flaming_torch.dm @@ -32,11 +32,11 @@ /obj/item/device/flashlight/flaming_torch/attack_self(mob/user) if(..()) if(on) - GLOB.processing_objects += src + START_PROCESSING(SSobj, src) else - GLOB.processing_objects -= src + STOP_PROCESSING(SSobj, src) -/obj/item/device/flashlight/flaming_torch/process() +/obj/item/device/flashlight/flaming_torch/Process() fuel_ticks_left -= 1 if(fuel_ticks_left <= 0) set_light(0) diff --git a/code/modules/halo/misc/gas_collector.dm b/code/modules/halo/misc/gas_collector.dm index 20c9324398ad3..b6570db450712 100644 --- a/code/modules/halo/misc/gas_collector.dm +++ b/code/modules/halo/misc/gas_collector.dm @@ -133,7 +133,7 @@ venting += 1 -/obj/machinery/portable_atmospherics/gas_collector/process() +/obj/machinery/portable_atmospherics/gas_collector/Process() ..() if(venting > 0) diff --git a/code/modules/halo/misc/gas_geyser.dm b/code/modules/halo/misc/gas_geyser.dm index f771b47f6386a..3abe4356bd874 100644 --- a/code/modules/halo/misc/gas_geyser.dm +++ b/code/modules/halo/misc/gas_geyser.dm @@ -19,7 +19,7 @@ /obj/structure/geyser/New() . = ..() - GLOB.processing_objects.Add(src) + START_PROCESSING(SSobj, src) time_between_vent = rand(30,200) duration_of_vent = rand(10, 100) time_last_vent = world.time - rand(0, time_between_vent) @@ -46,7 +46,7 @@ /obj/structure/geyser/ex_act() return -/obj/structure/geyser/process() +/obj/structure/geyser/Process() if(venting) vent_gases() if(world.time > time_last_vent + duration_of_vent) diff --git a/code/modules/halo/misc/loot_distributor.dm b/code/modules/halo/misc/loot_distributor.dm index 525951ae1ea63..6b8629fe06a4a 100644 --- a/code/modules/halo/misc/loot_distributor.dm +++ b/code/modules/halo/misc/loot_distributor.dm @@ -22,9 +22,9 @@ var/global/datum/loot_distributor/loot_distributor = new loclist = list() loclist += loc distribute_locs[type] = loclist - GLOB.processing_objects |= src + START_PROCESSING(SSobj, src) -/datum/loot_distributor/proc/process() +/datum/loot_distributor/Process() for(var/tag in distribute_locs) var/list/lootlist = get_lootlist_for_type(tag) var/list/loclist = distribute_locs[tag] diff --git a/code/modules/halo/misc/payload.dm b/code/modules/halo/misc/payload.dm index bb20d4ae43083..b41996f946607 100644 --- a/code/modules/halo/misc/payload.dm +++ b/code/modules/halo/misc/payload.dm @@ -43,7 +43,7 @@ log_and_message_admins(" primed a nuke/anti-matter charge.",user) explode_at = world.time + seconds_to_explode SECONDS exploding = 1 - GLOB.processing_objects += src + START_PROCESSING(SSobj, src) message2discord(config.oni_discord, "Alert! Payload device armed by [user.real_name] ([user.ckey]) @ ([loc.x],[loc.y],[loc.z])") set_anchor(1) checkoverlay(1) @@ -62,7 +62,7 @@ set_anchor(0) desc = initial(desc) checkoverlay(0) - GLOB.processing_objects -= src + STOP_PROCESSING(SSobj, src) if(do_arm_disarm_alert) var/om_obj = map_sectors["[z]"] if(om_obj) @@ -91,7 +91,7 @@ if(exploding) desc = explodedesc + " [(explode_at - world.time)/10] seconds remain." if(exploding && world.time >= explode_at) - GLOB.processing_objects -= src + STOP_PROCESSING(SSobj, src) var/explode_datum = new explodetype(src) loc = null qdel(explode_datum) @@ -101,7 +101,7 @@ /obj/payload/proc/set_anchor(var/onoff) anchored = onoff -/obj/payload/process() +/obj/payload/Process() checkexplode() //SELF DESTRUCT PAYLOAD DOES NOT MOVE// @@ -202,7 +202,7 @@ b.strength*PAYLOAD_EXPLOSION_MULT_FLASH/3\ ) if(OM) - GLOB.processing_objects |= OM //If they're not already processing, they better start now! + START_PROCESSING(SSobj, OM) //If they're not already processing, they better start now! OM.superstructure_process() /datum/explosion/nuclearexplosion/New(var/obj/payload/b) diff --git a/code/modules/halo/misc/xeno_plant.dm b/code/modules/halo/misc/xeno_plant.dm index 36327501fea4d..72d26b98e5514 100644 --- a/code/modules/halo/misc/xeno_plant.dm +++ b/code/modules/halo/misc/xeno_plant.dm @@ -21,10 +21,10 @@ . = ..() icon_state = "weird_plant[pick("1","2","3")]" internal_container = new/datum/reagents(20,src) - GLOB.processing_objects += src + START_PROCESSING(SSobj, src) /obj/structure/xeno_plant/Destroy() - GLOB.processing_objects -= src + STOP_PROCESSING(SSobj, src) . = ..() /obj/structure/xeno_plant/attack_hand(var/mob/living/carbon/human/M) @@ -40,7 +40,7 @@ visible_message("[M] picks one of the fruits off of [src]") next_fruit_at = world.time + XENO_PLANT_FRUITGROW_DELAY -/obj/structure/xeno_plant/process() +/obj/structure/xeno_plant/Process() if(world.time > next_smoke_at) next_smoke_at = world.time + XENO_PLANT_SMOKE_DELAY internal_container.add_reagent(pick(reagents_can_spawn),5) diff --git a/code/modules/halo/overmap/base_npc_ships.dm b/code/modules/halo/overmap/base_npc_ships.dm index f60e0504da9e4..1c16eb643e50b 100644 --- a/code/modules/halo/overmap/base_npc_ships.dm +++ b/code/modules/halo/overmap/base_npc_ships.dm @@ -152,7 +152,7 @@ GLOBAL_LIST_INIT(om_base_sectors, list()) for(var/z_level in map_z) shipmap_handler.free_map(z_level) map_z -= z_level - GLOB.processing_objects -= src + STOP_PROCESSING(SSobj, src) if(my_faction) my_faction.npc_ships -= src qdel(src) @@ -204,7 +204,7 @@ GLOBAL_LIST_INIT(om_base_sectors, list()) else return ..() -/obj/effect/overmap/ship/npc_ship/process() +/obj/effect/overmap/ship/npc_ship/Process() //despawn after a while if(world.time >= unload_at && unload_at != 0) lose_to_space() @@ -272,7 +272,7 @@ GLOBAL_LIST_INIT(om_base_sectors, list()) if(isnull(light_list)) light_list = map_z var/list/lights_reset = list() //FORMAT light ref, original light val - for(var/obj/machinery/light/light in GLOB.machines) + for(var/obj/machinery/light/light in SSmachines.machinery) if(!(text2num("[light.z]") in light_list)) continue var/orig_range = light.light_range @@ -310,12 +310,12 @@ GLOBAL_LIST_INIT(om_base_sectors, list()) mapload_reset_lights() lighting_overlays_initialised = TRUE - makepowernets() + SSmachines.makepowernets() cargo_init() create_dropship_markers() damage_spawned_ship() - GLOB.processing_objects |= src + START_PROCESSING(SSobj, src) superstructure_failing = 0 //If we had a process tick inbetween all of this, let's reset our superstructure failure status. /obj/effect/overmap/ship/npc_ship/proc/damage_spawned_ship() diff --git a/code/modules/halo/overmap/combat_npc_ship.dm b/code/modules/halo/overmap/combat_npc_ship.dm index 1ff5310072401..c176462466e40 100644 --- a/code/modules/halo/overmap/combat_npc_ship.dm +++ b/code/modules/halo/overmap/combat_npc_ship.dm @@ -97,7 +97,7 @@ radio_message( pick(messages_target_found) + " [target]. ([target.x],[target.y])") target_loc = null -/obj/effect/overmap/ship/npc_ship/combat/process() +/obj/effect/overmap/ship/npc_ship/combat/Process() if(hull <= initial(hull)/4) return ..() if(is_player_controlled()) diff --git a/code/modules/halo/overmap/fusion_thruster.dm b/code/modules/halo/overmap/fusion_thruster.dm index 80676917469e7..c7f38c72e6a13 100644 --- a/code/modules/halo/overmap/fusion_thruster.dm +++ b/code/modules/halo/overmap/fusion_thruster.dm @@ -72,7 +72,7 @@ QDEL_NULL(controller) . = ..() -/obj/machinery/fusion_thruster/process() +/obj/machinery/fusion_thruster/Process() if(use_power == 2) if(world.time > last_burn + 30) use_power = 1 diff --git a/code/modules/halo/overmap/nav_data_computer.dm b/code/modules/halo/overmap/nav_data_computer.dm index ab4bc5a6cd770..766982a2e04c9 100644 --- a/code/modules/halo/overmap/nav_data_computer.dm +++ b/code/modules/halo/overmap/nav_data_computer.dm @@ -21,13 +21,13 @@ /obj/machinery/nav_computer/LateInitialize() . = ..() - GLOB.processing_objects += src + START_PROCESSING(SSobj, src) -/obj/machinery/nav_computer/process() +/obj/machinery/nav_computer/Process() var/obj/effect/overmap/ship/our_om = map_sectors["[z]"] if(istype(our_om)) our_om.nav_comp = src - GLOB.processing_objects -= src + STOP_PROCESSING(SSobj, src) /obj/machinery/nav_computer/examine(var/mob/examiner) . = ..() diff --git a/code/modules/halo/overmap/npc_shipmap_handler.dm b/code/modules/halo/overmap/npc_shipmap_handler.dm index 2727c1875ff82..c7f2c0e570289 100644 --- a/code/modules/halo/overmap/npc_shipmap_handler.dm +++ b/code/modules/halo/overmap/npc_shipmap_handler.dm @@ -50,7 +50,7 @@ var/global/datum/npc_ship_map_handler/shipmap_handler = new if(del_me) obj_to_clear.loc = null - GLOB.processing_objects -= obj_to_clear + STOP_PROCESSING(SSobj, obj_to_clear) qdel(obj_to_clear) to_clear.ChangeTurf(/turf/space) if(turf_ticker >= PER_PASS_DELETE_LIMIT) diff --git a/code/modules/halo/overmap/slipspace/process.dm b/code/modules/halo/overmap/slipspace/process.dm index de9fc363d502e..06d9b92eacf3d 100644 --- a/code/modules/halo/overmap/slipspace/process.dm +++ b/code/modules/halo/overmap/slipspace/process.dm @@ -1,5 +1,5 @@ -/obj/machinery/slipspace_engine/process() +/obj/machinery/slipspace_engine/Process() if(current_charge_ticks) if(powered()) if(current_charge_ticks < target_charge_ticks) diff --git a/code/modules/halo/overmap/slipspace_drive.dm b/code/modules/halo/overmap/slipspace_drive.dm index 25e812b6172f4..71bc4be9e00da 100644 --- a/code/modules/halo/overmap/slipspace_drive.dm +++ b/code/modules/halo/overmap/slipspace_drive.dm @@ -24,7 +24,7 @@ if(slipspace_jump_time) if(alert("Do you want to shutdown the slipspace engine and remain in the system?","Shutdown slipspace jump","Shutdown","Cancel") == "Shutdown") slipspace_jump_time = 0 - GLOB.processing_objects -= src + STOP_PROCESSING(SSobj, src) src.visible_message("[user] begins working at the console of [src]...") to_chat(user,"You shutdown the slipspace engine.") else @@ -33,17 +33,17 @@ src.visible_message("[user] begins working at the console of [src]...") if(do_after(user, slipspace_activate_timer)) slipspace_jump_time = world.time + slipspace_chargeup_timer - GLOB.processing_objects |= src + START_PROCESSING(SSobj, src) log_admin("[user] the [user.mind.assigned_role] (CKEY: [user.ckey]) activated the slipspace engine. Jump timer: [slipspace_chargeup_timer / 10] seconds.") if(istype(ship)) to_chat(user,"[src] has been activated. [ship] will enter slipspace in [slipspace_chargeup_timer / 10] seconds.") else to_chat(user,"You are unable to decipher how [src] works.") -/obj/structure/covenant_slipspace/process() +/obj/structure/covenant_slipspace/Process() if(slipspace_jump_time && world.time > slipspace_jump_time) slipspace_jump_time = 0 - GLOB.processing_objects -= src + STOP_PROCESSING(SSobj, src) var/obj/effect/overmap/ship/ship = map_sectors["[z]"] if(istype(ship)) //hard brake the ship to avoid visual bugs with the slipspace effect diff --git a/code/modules/halo/overmap/umbilicals.dm b/code/modules/halo/overmap/umbilicals.dm index b6abce8f67081..961c9cce88d2d 100644 --- a/code/modules/halo/overmap/umbilicals.dm +++ b/code/modules/halo/overmap/umbilicals.dm @@ -23,7 +23,7 @@ . = ..() if(initial(broke) == -1) broke = FALSE - GLOB.processing_objects += src + START_PROCESSING(SSobj, src) /obj/docking_umbilical/ex_act() if(current_connected) @@ -43,10 +43,10 @@ if(!GLOB.using_map.use_overmap) return INITIALIZE_HINT_QDEL -/obj/docking_umbilical/process() +/obj/docking_umbilical/Process() if(isnull(our_ship)) ship_setup() - GLOB.processing_objects -= src + STOP_PROCESSING(SSobj, src) /obj/docking_umbilical/proc/visual_umbi_change(var/contract = 0,var/no_message = 0) if(contract == 1) diff --git a/code/modules/halo/overmap/weapons/Energy_projector.dm b/code/modules/halo/overmap/weapons/Energy_projector.dm index 02278b6ab0181..4afcf8fb754a2 100644 --- a/code/modules/halo/overmap/weapons/Energy_projector.dm +++ b/code/modules/halo/overmap/weapons/Energy_projector.dm @@ -8,12 +8,12 @@ /turf/unsimulated/floor/lava/glassed_turf/New() cool_at = world.time + cooling_delay - GLOB.processing_objects += src + START_PROCESSING(SSobj, src) . = ..() -/turf/unsimulated/floor/lava/glassed_turf/process() +/turf/unsimulated/floor/lava/glassed_turf/Process() if(world.time >= cool_at) - GLOB.processing_objects -= src + STOP_PROCESSING(SSobj, src) ChangeTurf(turf_replacewith) /turf/unsimulated/floor/lava/glassed_turf/to_space diff --git a/code/modules/halo/overmap/weapons/MAC.dm b/code/modules/halo/overmap/weapons/MAC.dm index 67b42a16d1942..8cdef38a4cf0b 100644 --- a/code/modules/halo/overmap/weapons/MAC.dm +++ b/code/modules/halo/overmap/weapons/MAC.dm @@ -298,10 +298,10 @@ /obj/structure/repair_component/mac_console/finalise_repair() reboot_at = world.time + CONSOLE_REBOOT_TIME - GLOB.processing_objects += src + START_PROCESSING(SSobj, src) name = "Rebooting MAC Fire Control" -/obj/structure/repair_component/mac_console/process() +/obj/structure/repair_component/mac_console/Process() if(world.time > reboot_at) new repair_into (loc) qdel(src) diff --git a/code/modules/halo/overmap/weapons/auto_mac_program.dm b/code/modules/halo/overmap/weapons/auto_mac_program.dm index cff5e7e86f42d..2de4222116f53 100644 --- a/code/modules/halo/overmap/weapons/auto_mac_program.dm +++ b/code/modules/halo/overmap/weapons/auto_mac_program.dm @@ -23,7 +23,7 @@ var/obj/machinery/overmap_weapon_console/mac/linked_manual_console var/list/linked_devices = list() -/datum/nano_module/auto_mac/proc/process() +/datum/nano_module/auto_mac/Process() target_ship() attempt_fire() @@ -112,7 +112,7 @@ prox_trigger = new (host_vessel, /datum/nano_module/auto_mac/proc/trigger_prox, /datum/nano_module/auto_mac/proc/prox_turfs_changed, overmap_range, 0, src) prox_trigger.register_turfs() - GLOB.processing_objects.Add(src) + START_PROCESSING(SSobj, src) linked_manual_console = locate() in range(1, host) if(linked_manual_console) @@ -157,7 +157,7 @@ prox_trigger = null target_ships = list() targetted_ship = null - GLOB.processing_objects.Remove(src) + STOP_PROCESSING(SSobj, src) if(linked_manual_console) linked_manual_console.automated = 0 diff --git a/code/modules/halo/overmap/weapons/laser_designator.dm b/code/modules/halo/overmap/weapons/laser_designator.dm index a5f3bf5b0f7ad..8b53874264f0c 100644 --- a/code/modules/halo/overmap/weapons/laser_designator.dm +++ b/code/modules/halo/overmap/weapons/laser_designator.dm @@ -71,9 +71,9 @@ else name = "Bombardment Beacon [rand(0,999)] - [area_contained.name]" created_at = world.time - GLOB.processing_objects += src + START_PROCESSING(SSobj, src) -/obj/effect/bombardment_beacon/process() +/obj/effect/bombardment_beacon/Process() if(world.time > (created_at + BEACON_EXPIRE_TIME)) qdel(src) diff --git a/code/modules/halo/overmap/weapons/proj_deck_gun.dm b/code/modules/halo/overmap/weapons/proj_deck_gun.dm index 2c93365f49a57..b9e4b40d6bf3a 100644 --- a/code/modules/halo/overmap/weapons/proj_deck_gun.dm +++ b/code/modules/halo/overmap/weapons/proj_deck_gun.dm @@ -115,7 +115,7 @@ if(!control_tag) control_tag = "[tag_prefix] - [z]" -/obj/machinery/deck_gun/process() +/obj/machinery/deck_gun/Process() if(world.time > next_reload_time && next_reload_time != 0) reload_gun() next_reload_time = world.time + round_reload_time @@ -134,14 +134,14 @@ if(new_rounds > max_rounds_loadable) next_reload_time = 0 rounds_loaded = max_rounds_loadable - GLOB.processing_objects -= src + STOP_PROCESSING(SSobj, src) else rounds_loaded = new_rounds /obj/machinery/deck_gun/proc/can_fire() if(rounds_loaded > 0) return 1 - GLOB.processing_objects += src + START_PROCESSING(SSobj, src) if(next_reload_time == 0) next_reload_time = world.time + round_reload_time return 0 diff --git a/code/modules/halo/power/cooling_manifold.dm b/code/modules/halo/power/cooling_manifold.dm index d05e5f2790ce2..ccdc6ef095475 100644 --- a/code/modules/halo/power/cooling_manifold.dm +++ b/code/modules/halo/power/cooling_manifold.dm @@ -61,7 +61,7 @@ playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1) -/obj/machinery/atmospherics/binary/fusion_cooling/process() +/obj/machinery/atmospherics/binary/fusion_cooling/Process() last_power_draw = 0 last_flow_rate = 0 diff --git a/code/modules/halo/power/reactor.dm b/code/modules/halo/power/reactor.dm index b0bcfab9efa1f..cb5a61a91c464 100644 --- a/code/modules/halo/power/reactor.dm +++ b/code/modules/halo/power/reactor.dm @@ -55,7 +55,7 @@ fuel_overlay = new('fusion_drive.dmi', "fuel[fuelval]") overlays += fuel_overlay -/obj/machinery/power/fusion_drive/process() +/obj/machinery/power/fusion_drive/Process() //if coolant isn't working properly, lose a little bit of heat naturally if(cooled_last_cycle < ambient_cooling) heat_energy -= (ambient_cooling - cooled_last_cycle) diff --git a/code/modules/halo/power/reactor_simple.dm b/code/modules/halo/power/reactor_simple.dm index 1eb0d3b197e9a..a3dcef552cf32 100644 --- a/code/modules/halo/power/reactor_simple.dm +++ b/code/modules/halo/power/reactor_simple.dm @@ -21,7 +21,7 @@ eject_fuel() return -/obj/machinery/power/fusion_drive_simple/process() +/obj/machinery/power/fusion_drive_simple/Process() if(held_fuel && held_fuel.fuel_left > 0) held_fuel.fuel_left = max(held_fuel.fuel_left - fuel_consumption_rate, 0) diff --git a/code/modules/halo/research/machines/dissembler.dm b/code/modules/halo/research/machines/dissembler.dm index 6e77cbee83d1f..59c4c99381b3a 100644 --- a/code/modules/halo/research/machines/dissembler.dm +++ b/code/modules/halo/research/machines/dissembler.dm @@ -46,7 +46,7 @@ /obj/machinery/research/component_dissembler/attempt_load_item(var/obj/item/I, var/mob/user as mob) . = ..() if(.) - GLOB.processing_objects += src + START_PROCESSING(SSobj, src) update_use_power(2) icon_state = "h_lathe_wloop" flick("h_lathe_load", src) @@ -54,7 +54,7 @@ //larger items take longer to take apart max_progress = I.w_class * 5 -/obj/machinery/research/component_dissembler/process() +/obj/machinery/research/component_dissembler/Process() . = ..() if(loaded_item) if(progress >= max_progress) @@ -66,7 +66,7 @@ qdel(loaded_item) loaded_item = null progress = 0 - GLOB.processing_objects -= src + STOP_PROCESSING(SSobj, src) icon_state = "h_lathe" else progress += decon_speed diff --git a/code/modules/halo/research/machines/protolathe/process.dm b/code/modules/halo/research/machines/protolathe/process.dm index eb733cfc432da..0318dc1f45c9d 100644 --- a/code/modules/halo/research/machines/protolathe/process.dm +++ b/code/modules/halo/research/machines/protolathe/process.dm @@ -1,5 +1,5 @@ -/obj/machinery/research/protolathe/process() +/obj/machinery/research/protolathe/Process() . = ..() if(do_reagents_update) diff --git a/code/modules/halo/squads/squad-waypoint-controller.dm b/code/modules/halo/squads/squad-waypoint-controller.dm index db51b42260b28..938072b29dc4c 100644 --- a/code/modules/halo/squads/squad-waypoint-controller.dm +++ b/code/modules/halo/squads/squad-waypoint-controller.dm @@ -23,8 +23,7 @@ created_waypoint.waypoint_name = "[waypoint_name_defaults[active_waypoints.len]]" inform_waypoint_modification(created_waypoint) update_linked_waypoint_locations() - if(!(src in GLOB.processing_objects)) - GLOB.processing_objects += src + START_PROCESSING(SSobj, src) return created_waypoint /datum/waypoint_controller/proc/cole_protocol() //This wipes the controller, removing all waypoints and linked devices before deleting itself. @@ -60,7 +59,7 @@ update_linked_waypoint_locations() qdel(waypoint) if(active_waypoints.len == 0) - GLOB.processing_objects -= src + STOP_PROCESSING(SSobj, src) /datum/waypoint_controller/proc/get_waypoints() var/list/waypoints_by_name = list() @@ -78,7 +77,7 @@ device.update_known_waypoints(active_waypoints) device.process_hud() -/datum/waypoint_controller/proc/process() +/datum/waypoint_controller/Process() update_linked_waypoint_locations() #undef WAYPOINT_DEFAULT_NAME_LIST diff --git a/code/modules/halo/structures/blast_door_control.dm b/code/modules/halo/structures/blast_door_control.dm index 7246932daf7c4..232cb7e89f188 100644 --- a/code/modules/halo/structures/blast_door_control.dm +++ b/code/modules/halo/structures/blast_door_control.dm @@ -10,7 +10,7 @@ obj/machinery/door/blast var/datum/radio_frequency/radio_connection var/cur_command = null //the command the door is currently attempting to complete -obj/machinery/door/blast/process() +obj/machinery/door/blast/Process() ..() if(arePowerSystemsOn()) execute_current_command() @@ -199,7 +199,7 @@ obj/machinery/airlock_sensor/attack_hand(mob/user) radio_connection.post_signal(src, signal, range = AIRLOCK_CONTROL_RANGE, filter = RADIO_AIRLOCK) flick("airlock_sensor_cycle", src) -obj/machinery/airlock_sensor/process() +obj/machinery/airlock_sensor/Process() if(on) var/datum/gas_mixture/air_sample = return_air() var/pressure = round(air_sample.return_pressure(),0.1) diff --git a/code/modules/halo/trade/trade_shuttle.dm b/code/modules/halo/trade/trade_shuttle.dm index 5fbc1ce28125a..a6b062d34d0bf 100644 --- a/code/modules/halo/trade/trade_shuttle.dm +++ b/code/modules/halo/trade/trade_shuttle.dm @@ -82,7 +82,7 @@ moving_status = SHUTTLE_WARMUP warmup_time = world.time + warmup_length -/datum/shuttle/autodock/ferry/trade/process() +/datum/shuttle/autodock/ferry/trade/Process() . = ..() switch(moving_status) if(SHUTTLE_IDLE) diff --git a/code/modules/halo/unsc/overmind.dm b/code/modules/halo/unsc/overmind.dm index 024cd6ab96eca..468b5c8376699 100644 --- a/code/modules/halo/unsc/overmind.dm +++ b/code/modules/halo/unsc/overmind.dm @@ -16,7 +16,7 @@ GLOBAL_DATUM(unsc_overmind, /datum/npc_overmind/unsc) if(!GLOB.unsc_overmind) GLOB.unsc_overmind = new() controlling_overmind = GLOB.unsc_overmind - GLOB.processing_objects |= GLOB.unsc_overmind + START_PROCESSING(SSobj, GLOB.unsc_overmind) GLOB.unsc_overmind.overmind_active = 1 GLOB.unsc_overmind.reports.Cut() //We're likely activating the overmind here. Cut all previous reports out, they're likely outdated. diff --git a/code/modules/halo/unsc/spartan_gear.dm b/code/modules/halo/unsc/spartan_gear.dm index 62a98efaaa613..6014a5fe613ae 100644 --- a/code/modules/halo/unsc/spartan_gear.dm +++ b/code/modules/halo/unsc/spartan_gear.dm @@ -62,7 +62,7 @@ //Twice as good at handling toxin damage... but not any tougher toxin_danger_level = 120 -/obj/item/organ/internal/liver/spartan/process() +/obj/item/organ/internal/liver/spartan/Process() //To allow some filtering first, we're putting off our ..() call if(owner.chem_effects[CE_ALCOHOL] && owner.chem_effects[CE_ALCOHOL_TOXIC]) //Remove an additional amount of alcohol @@ -85,7 +85,7 @@ min_broken_damage = 45 //give spartans some slight regen -/obj/item/organ/internal/heart/spartan/process() +/obj/item/organ/internal/heart/spartan/Process() . = ..() for(var/obj/item/organ/external/e in owner.bad_external_organs) if(!e.clamped() && prob(SPARTAN_BLEEDBLOCK_CHANCE)) diff --git a/code/modules/halo/vehicles/rearm_repair_station.dm b/code/modules/halo/vehicles/rearm_repair_station.dm index 68274c4fbf6ad..94bc61b91a5d5 100644 --- a/code/modules/halo/vehicles/rearm_repair_station.dm +++ b/code/modules/halo/vehicles/rearm_repair_station.dm @@ -26,7 +26,7 @@ var/remove_targ = input(attacker,"Stop targeting [target_vic] for rearm / repair?","Rearm/Repair selection","No") in list("Yes","No") if(remove_targ == "Yes") target_vic = null - GLOB.processing_objects -= src + STOP_PROCESSING(SSobj, src) return var/list/vics_in_view = list() @@ -37,7 +37,7 @@ return target_vic = repair_target to_chat(attacker,"Rearm and Repair active on [target_vic]") - GLOB.processing_objects += src + START_PROCESSING(SSobj, src) /obj/structure/rearm_repair_station/proc/consume_material(var/amount) var/new_mat = material_stored - amount @@ -61,13 +61,13 @@ consume_material(-to_add) to_chat(user,"[src] processes [I] into [to_add] units of fabricator materials.") -/obj/structure/rearm_repair_station/process() +/obj/structure/rearm_repair_station/Process() if(world.time < next_rearm_repair_tick) return if(target_vic) if(get_dist(src,target_vic) > REARM_REPAIR_RANGE) target_vic = null - GLOB.processing_objects -= src + STOP_PROCESSING(SSobj, src) return var/did_something = 0 if(target_vic.can_smoke && target_vic.smoke_ammo < target_vic.smoke_ammo_max) @@ -98,9 +98,9 @@ if(!did_something) visible_message("[src] sounds a time-out warning, citing lack of action and de-targeting [target_vic]") target_vic = null - GLOB.processing_objects -= src + STOP_PROCESSING(SSobj, src) else - GLOB.processing_objects -= src //Why are we processing when we have no vehicle??? + STOP_PROCESSING(SSobj, src) //Why are we processing when we have no vehicle??? next_rearm_repair_tick = world.time + REARM_REPAIR_DELAY //take material (steel?), allow selection of vehicle to resupply, take time to resupply / repair diff --git a/code/modules/halo/vehicles/vehiclebase.dm b/code/modules/halo/vehicles/vehiclebase.dm index 6d8c3da2b4e22..b2d4368d5a421 100644 --- a/code/modules/halo/vehicles/vehiclebase.dm +++ b/code/modules/halo/vehicles/vehiclebase.dm @@ -141,7 +141,7 @@ comp_prof = new comp_prof(src) if(melee_type) melee_weapon = new melee_type(null) - GLOB.processing_objects += src + START_PROCESSING(SSobj, src) update_object_sprites() if(light_range != 0) verbs += /obj/vehicles/verb/toggle_headlights @@ -265,7 +265,7 @@ /obj/vehicles/Destroy() if(melee_weapon) qdel(melee_weapon) - GLOB.processing_objects -= src + STOP_PROCESSING(SSobj, src) kick_occupants() GLOB.emp_candidates -= src . = ..() @@ -320,7 +320,7 @@ /obj/vehicles/proc/inactive_pilot_effects() //Overriden on a vehicle-by-vehicle basis. -/obj/vehicles/process() +/obj/vehicles/Process() if(world.time % 3) comp_prof.give_gunner_weapons(src) update_object_sprites() diff --git a/code/modules/halo/weapons/automated_AA.dm b/code/modules/halo/weapons/automated_AA.dm index e3490331411a3..64a56ce3d1bb8 100644 --- a/code/modules/halo/weapons/automated_AA.dm +++ b/code/modules/halo/weapons/automated_AA.dm @@ -60,13 +60,13 @@ return targets_tracking[targ] = world.time if(!processing) - GLOB.processing_objects += src + START_PROCESSING(SSobj, src) processing = 1 /obj/structure/automated_anti_air/proc/remove_target(var/targ) targets_tracking -= targ if(targets_tracking.len == 0) - GLOB.processing_objects -= src + STOP_PROCESSING(SSobj, src) processing = 0 /obj/structure/automated_anti_air/proc/check_target_still_valid(var/atom/targ) @@ -80,7 +80,7 @@ /obj/structure/automated_anti_air/proc/do_AA_effect_at(var/turf/location) explosion(location,-1,1,-1,10) -/obj/structure/automated_anti_air/process() +/obj/structure/automated_anti_air/Process() if(!active) return for(var/atom/movable/target in targets_tracking) diff --git a/code/modules/halo/weapons/autoturret.dm b/code/modules/halo/weapons/autoturret.dm index 19b224b2c8684..a817cabad456a 100644 --- a/code/modules/halo/weapons/autoturret.dm +++ b/code/modules/halo/weapons/autoturret.dm @@ -48,7 +48,7 @@ visible_message("[user] activates [src]") targets_in_view.Cut() anchored = 1 - GLOB.processing_objects += src + START_PROCESSING(SSobj, src) /obj/structure/autoturret/verb/deactivate_autoturret() set name = "Deactivate Autoturret" @@ -66,7 +66,7 @@ visible_message("[user] deactivates [src]") targets_in_view.Cut() anchored = 0 - GLOB.processing_objects -= src + STOP_PROCESSING(SSobj, src) /obj/structure/autoturret/verb/clear_friendlies() set name = "Clear Friendlies" @@ -108,7 +108,7 @@ visible_message("[p] damages [src]'s ammunition storage!") loaded_ammo.Cut(loaded_ammo.len-(p.damage/2)) -/obj/structure/autoturret/process() +/obj/structure/autoturret/Process() for(var/mob/living/m in view(vision_range,loc)) if(!(m in targets_in_view) && !(m in friendlies_stored) && (!(m.health <= 0) || m.stat == CONSCIOUS)) targets_in_view += m @@ -164,7 +164,7 @@ loaded_ammo += new to_fabricate /obj/structure/autoturret/Destroy() - GLOB.processing_objects -= src + STOP_PROCESSING(SSobj, src) . = ..() /obj/structure/autoturret/ONI diff --git a/code/modules/halo/weapons/covenant/ammo.dm b/code/modules/halo/weapons/covenant/ammo.dm index f9a3a3301a964..2653a49c46a66 100644 --- a/code/modules/halo/weapons/covenant/ammo.dm +++ b/code/modules/halo/weapons/covenant/ammo.dm @@ -130,7 +130,7 @@ var/die_at = 0 var/our_dam = 0 -/obj/item/weapon/material/shard/shrapnel/needleshrap/process() +/obj/item/weapon/material/shard/shrapnel/needleshrap/Process() if(world.time >= die_at) var/mob/living/m = loc if(istype(m)) @@ -176,7 +176,7 @@ if(istype(needle)) needle.our_dam *= NEEDLER_SUPERCOMBINE_SHRAPNEL_DAMAGE_MULT needle.die_at = 0 - needle.process() + needle.Process() else L.embedded -= I L.pinned -= I @@ -189,7 +189,7 @@ var/obj/item/weapon/material/shard/shrapnel/needleshrap/shard = new shard.name = shard_name shard.die_at = world.time + NEEDLER_SHARD_DET_TIME - GLOB.processing_objects += shard + START_PROCESSING(SSobj, shard) shard.our_dam = shrapnel_damage //We're doing some speshul things here with out embed, so let's not do the usual damage. L.contents += shard diff --git a/code/modules/halo/weapons/covenant/melee.dm b/code/modules/halo/weapons/covenant/melee.dm index 1d0e6d6848cd9..23039a49c5a2a 100644 --- a/code/modules/halo/weapons/covenant/melee.dm +++ b/code/modules/halo/weapons/covenant/melee.dm @@ -281,7 +281,7 @@ Luckily, this isn't a downside due to the explosive properties of such a large a regen_at = -1 update_icon() set_blade_active(1) - GLOB.processing_objects -= src + STOP_PROCESSING(SSobj, src) /obj/item/weapon/melee/blamite/proc/det_in_hand() regen_at = world.time + regen_delay * 2 @@ -330,7 +330,7 @@ Luckily, this isn't a downside due to the explosive properties of such a large a return user.visible_message("[user.name] primes their [src] for detonation!") explode_at = world.time + explode_delay - GLOB.processing_objects |= src + START_PROCESSING(SSobj, src) update_icon() /obj/item/weapon/melee/blamite/can_execute(mob/living/carbon/human/user, mob/living/carbon/human/victim) @@ -344,9 +344,9 @@ Luckily, this isn't a downside due to the explosive properties of such a large a explode_delay = 1 pre_explode_in_player(user, victim, TRUE) explode_delay = initial(explode_delay) - GLOB.processing_objects |= src + START_PROCESSING(SSobj, src) -/obj/item/weapon/melee/blamite/process() +/obj/item/weapon/melee/blamite/Process() if(explode_at != -1 && world.time > explode_at) det_in_hand() if(regen_at != -1 && world.time > regen_at) diff --git a/code/modules/halo/weapons/covenant/shield_gauntlet.dm b/code/modules/halo/weapons/covenant/shield_gauntlet.dm index 7587c2eb768ec..6deca3fb6d1e7 100644 --- a/code/modules/halo/weapons/covenant/shield_gauntlet.dm +++ b/code/modules/halo/weapons/covenant/shield_gauntlet.dm @@ -158,7 +158,7 @@ //set a delay on recharging if(!shield_next_charge) - GLOB.processing_objects |= src + START_PROCESSING(SSobj, src) shield_next_charge = world.time + shield_recharge_delay //subtract the damage @@ -223,9 +223,9 @@ else action.button.maptext = null -/obj/item/clothing/gloves/shield_gauntlet/process() +/obj/item/clothing/gloves/shield_gauntlet/Process() if(shield_current_charge >= shield_max_charge) - GLOB.processing_objects -= src + STOP_PROCESSING(SSobj, src) shield_next_charge = 0 return diff --git a/code/modules/halo/weapons/drop_pod_beacon.dm b/code/modules/halo/weapons/drop_pod_beacon.dm index 03b9d686b26ab..a94b8210ea6c8 100644 --- a/code/modules/halo/weapons/drop_pod_beacon.dm +++ b/code/modules/halo/weapons/drop_pod_beacon.dm @@ -15,11 +15,11 @@ . = ..() icon_state = "[initial(icon_state)]_off" -/obj/item/drop_pod_beacon/process() +/obj/item/drop_pod_beacon/Process() if(world.time > time_expire_at && time_expire_at != 0) is_active = -1 visible_message("The lights on [name] darken, [name] shuts off.") - GLOB.processing_objects -= src + STOP_PROCESSING(SSobj, src) icon_state = "[initial(icon_state)]_burnout" return @@ -38,7 +38,7 @@ if(user) user.visible_message("[user] primes [src], activating the tracking module!") - GLOB.processing_objects += src + START_PROCESSING(SSobj, src) icon_state = "[initial(icon_state)]_on" is_active = 1 time_expire_at = world.time + time_to_expire diff --git a/code/modules/halo/weapons/forerunner/grenade.dm b/code/modules/halo/weapons/forerunner/grenade.dm index e9bf288a8cb0d..f40a02665ef0e 100644 --- a/code/modules/halo/weapons/forerunner/grenade.dm +++ b/code/modules/halo/weapons/forerunner/grenade.dm @@ -11,9 +11,9 @@ /obj/effect/splinter_field/Initialize() . = ..() - GLOB.processing_objects += src + START_PROCESSING(SSobj, src) -/obj/effect/splinter_field/process() +/obj/effect/splinter_field/Process() if(world.time >= die_at) qdel(src) diff --git a/code/modules/halo/weapons/gun_overheat.dm b/code/modules/halo/weapons/gun_overheat.dm index 53aeba11ca325..9817d7c85b2e9 100644 --- a/code/modules/halo/weapons/gun_overheat.dm +++ b/code/modules/halo/weapons/gun_overheat.dm @@ -10,7 +10,7 @@ var/datum/progressbar/heat_bar var/heat_per_shot = 1 -/obj/item/weapon/gun/process() +/obj/item/weapon/gun/Process() if(process_heat()) return @@ -52,7 +52,7 @@ if(heat_current > 0) if(!heat_bar) heat_bar = new (src.loc, overheat_capacity, src) - GLOB.processing_objects.Add(src) + START_PROCESSING(SSobj, src) heat_bar.update(heat_current) if(heat_current >= overheat_capacity) @@ -62,7 +62,7 @@ else qdel(heat_bar) heat_bar = null - GLOB.processing_objects.Remove(src) + STOP_PROCESSING(SSobj, src) /obj/item/weapon/gun/proc/overheat_sfx(var/origin) if(overheat_sfx) diff --git a/code/modules/halo/weapons/landmine.dm b/code/modules/halo/weapons/landmine.dm index d461110a164e9..d906e0af67051 100644 --- a/code/modules/halo/weapons/landmine.dm +++ b/code/modules/halo/weapons/landmine.dm @@ -59,14 +59,14 @@ /obj/item/device/landmine/proc/set_processing() if(!processing) processing = 1 - GLOB.processing_objects.Add(src) + START_PROCESSING(SSobj, src) /obj/item/device/landmine/proc/stop_processing() if(processing) - GLOB.processing_objects.Remove(src) + STOP_PROCESSING(SSobj, src) processing = 0 -/obj/item/device/landmine/process() +/obj/item/device/landmine/Process() switch(state) if(STATE_ARMING) if(world.time > arm_time) diff --git a/code/modules/halo/weapons/turrets/turret.dm b/code/modules/halo/weapons/turrets/turret.dm index cb211b38deb50..5eac2fc99f443 100644 --- a/code/modules/halo/weapons/turrets/turret.dm +++ b/code/modules/halo/weapons/turrets/turret.dm @@ -143,7 +143,7 @@ mob_manning.buckled = src give_manning_gun() handle_dir() - GLOB.processing_objects += src + START_PROCESSING(SSobj, src) /obj/structure/turret/proc/unman_turret() if(mob_manning) @@ -152,7 +152,7 @@ mob_manning.pixel_y = initial(mob_manning.pixel_y) remove_manning_gun() mob_manning = null - GLOB.processing_objects -= src + STOP_PROCESSING(SSobj, src) /obj/structure/turret/attack_hand(var/mob/user) if(!mob_manning) @@ -194,7 +194,7 @@ if(unman) unman_turret() -/obj/structure/turret/process() +/obj/structure/turret/Process() check_user_has_gun() handle_dir() diff --git a/code/modules/holodeck/HolodeckControl.dm b/code/modules/holodeck/HolodeckControl.dm index b75483be07dd7..d1ad2c186e1cf 100644 --- a/code/modules/holodeck/HolodeckControl.dm +++ b/code/modules/holodeck/HolodeckControl.dm @@ -174,7 +174,7 @@ if (. && active && (stat & NOPOWER)) emergencyShutdown() -/obj/machinery/computer/HolodeckControl/process() +/obj/machinery/computer/HolodeckControl/Process() for(var/item in holographic_objs) // do this first, to make sure people don't take items out when power is down. if(!(get_turf(item) in linkedholodeck)) derez(item, 0) diff --git a/code/modules/hydroponics/beekeeping/beehive.dm b/code/modules/hydroponics/beekeeping/beehive.dm index a448d4505ca63..f1673b50665c0 100644 --- a/code/modules/hydroponics/beekeeping/beehive.dm +++ b/code/modules/hydroponics/beekeeping/beehive.dm @@ -136,7 +136,7 @@ to_chat(user, "You take all filled honeycombs out.") return -/obj/machinery/beehive/process() +/obj/machinery/beehive/Process() if(closed && !smoked && bee_count) pollinate_flowers() update_icon() diff --git a/code/modules/hydroponics/seed_controller.dm b/code/modules/hydroponics/seed_controller.dm index 50794a3383eec..99c76eb9acaa2 100644 --- a/code/modules/hydroponics/seed_controller.dm +++ b/code/modules/hydroponics/seed_controller.dm @@ -42,7 +42,7 @@ var/global/datum/controller/plants/plant_controller // Set in New(). qdel(plant_controller) plant_controller = src setup() - process() + Process() // Predefined/roundstart varieties use a string key to make it // easier to grab the new variety when mutating. Post-roundstart @@ -131,7 +131,7 @@ var/global/datum/controller/plants/plant_controller // Set in New(). seed.set_trait(TRAIT_HIGHKPA_TOLERANCE,200) return seed -/datum/controller/plants/proc/process() +/datum/controller/plants/Process() processing = 1 spawn(0) set background = 1 @@ -150,7 +150,7 @@ var/global/datum/controller/plants/plant_controller // Set in New(). plant_queue -= plant if(!istype(plant)) continue - plant.process() + plant.Process() processed++ sleep(1) // Stagger processing out so previous tick can resolve (overlapping plant segments etc) sleep(max(1,(plant_tick_time-processed))) diff --git a/code/modules/hydroponics/seed_machines.dm b/code/modules/hydroponics/seed_machines.dm index 40185e25b975c..ea07368550ddf 100644 --- a/code/modules/hydroponics/seed_machines.dm +++ b/code/modules/hydroponics/seed_machines.dm @@ -41,7 +41,7 @@ var/failed_task = 0 var/disk_needs_genes = 0 -/obj/machinery/botany/process() +/obj/machinery/botany/Process() ..() if(!active) return diff --git a/code/modules/hydroponics/spreading/spreading_growth.dm b/code/modules/hydroponics/spreading/spreading_growth.dm index 6619e49458cb2..4c794b7dcc95f 100644 --- a/code/modules/hydroponics/spreading/spreading_growth.dm +++ b/code/modules/hydroponics/spreading/spreading_growth.dm @@ -42,7 +42,7 @@ if(neighbor.seed == src.seed) neighbor.neighbors -= T -/obj/effect/plant/process() +/obj/effect/plant/Process() // Something is very wrong, kill ourselves. if(!seed) diff --git a/code/modules/hydroponics/trays/tray.dm b/code/modules/hydroponics/trays/tray.dm index dd1dfcc25bdad..f69260b9c6b20 100644 --- a/code/modules/hydroponics/trays/tray.dm +++ b/code/modules/hydroponics/trays/tray.dm @@ -433,7 +433,7 @@ // Bookkeeping. check_health() force_update = 1 - process() + Process() return diff --git a/code/modules/hydroponics/trays/tray_process.dm b/code/modules/hydroponics/trays/tray_process.dm index a66b9121cbf09..da04eb3e58d36 100644 --- a/code/modules/hydroponics/trays/tray_process.dm +++ b/code/modules/hydroponics/trays/tray_process.dm @@ -1,4 +1,4 @@ -/obj/machinery/portable_atmospherics/hydroponics/process() +/obj/machinery/portable_atmospherics/hydroponics/Process() // Handle nearby smoke if any. for(var/obj/effect/effect/smoke/chem/smoke in view(1, src)) diff --git a/code/modules/hydroponics/trays/tray_soil.dm b/code/modules/hydroponics/trays/tray_soil.dm index 9e9eefdd789a4..7ced4c0fae32b 100644 --- a/code/modules/hydroponics/trays/tray_soil.dm +++ b/code/modules/hydroponics/trays/tray_soil.dm @@ -51,7 +51,7 @@ /obj/machinery/portable_atmospherics/hydroponics/soil/invisible/die() qdel(src) -/obj/machinery/portable_atmospherics/hydroponics/soil/invisible/process() +/obj/machinery/portable_atmospherics/hydroponics/soil/invisible/Process() if(!seed) qdel(src) return diff --git a/code/modules/integrated_electronics/input_output.dm b/code/modules/integrated_electronics/input_output.dm index 5239d4d803326..85981af084afa 100644 --- a/code/modules/integrated_electronics/input_output.dm +++ b/code/modules/integrated_electronics/input_output.dm @@ -329,7 +329,7 @@ . = list() . += "Current selection: [(current_console && current_console.id) || "None"]" . += "Please select a teleporter to lock in on:" - for(var/obj/machinery/teleport/hub/R in GLOB.machines) + for(var/obj/machinery/teleport/hub/R in SSmachines.machinery) var/obj/machinery/computer/teleporter/com = R.com if (istype(com, /obj/machinery/computer/teleporter) && com.locked && !com.one_time_use && com.operable()) .["[com.id] ([R.icon_state == "tele1" ? "Active" : "Inactive"])"] = "tport=[any2ref(com)]" diff --git a/code/modules/integrated_electronics/sensors.dm b/code/modules/integrated_electronics/sensors.dm index 575d6633b6368..2b6fc6ed699ee 100644 --- a/code/modules/integrated_electronics/sensors.dm +++ b/code/modules/integrated_electronics/sensors.dm @@ -163,14 +163,14 @@ return on = !on if(on) - GLOB.processing_objects.Add(src) + START_PROCESSING(SSobj, src) var/turf/T = get_turf(src) if(T) last_location = list(T.x, T.y, T.z) else - GLOB.processing_objects.Remove(src) + STOP_PROCESSING(SSobj, src) -/obj/item/integrated_circuit/accelerometer/process() +/obj/item/integrated_circuit/accelerometer/Process() var/turf/T = get_turf(src) if(!T) return diff --git a/code/modules/integrated_electronics/time.dm b/code/modules/integrated_electronics/time.dm index c0f3c97413356..6794a2b1ec7b1 100644 --- a/code/modules/integrated_electronics/time.dm +++ b/code/modules/integrated_electronics/time.dm @@ -81,24 +81,23 @@ /obj/item/integrated_circuit/time/ticker/Destroy() if(is_running) - GLOB.processing_objects -= src + STOP_PROCESSING(SSobj, src) . = ..() /obj/item/integrated_circuit/time/ticker/on_data_written() var/datum/integrated_io/do_tick = inputs[1] if(do_tick.data && !is_running) is_running = TRUE - GLOB.processing_objects |= src + START_PROCESSING(SSobj, src) else if(is_running) is_running = FALSE - GLOB.processing_objects -= src + STOP_PROCESSING(SSobj, src) ticks_completed = 0 -/obj/item/integrated_circuit/time/ticker/process() - var/process_ticks = process_schedule_interval("obj") - ticks_completed += process_ticks +/obj/item/integrated_circuit/time/ticker/Process(var/wait) + ticks_completed += wait if(ticks_completed >= ticks_to_pulse) - if(ticks_to_pulse >= process_ticks) + if(ticks_to_pulse >= wait) ticks_completed -= ticks_to_pulse else ticks_completed = 0 diff --git a/code/modules/lighting/lighting_source_ambient.dm b/code/modules/lighting/lighting_source_ambient.dm index e704328e37e42..d7c725890ff74 100644 --- a/code/modules/lighting/lighting_source_ambient.dm +++ b/code/modules/lighting/lighting_source_ambient.dm @@ -12,16 +12,16 @@ applied_lum_g = lum_g applied_lum_b = lum_b - GLOB.processing_objects |= src + START_PROCESSING(SSobj, src) turfs_to_update_lum = block(locate(1, 1, source_turf.z), locate(world.maxx, world.maxy, source_turf.z)) update_gen++ -/datum/light_source/ambient/proc/process() +/datum/light_source/ambient/Process() if(turfs_to_update_lum.len) apply_lum_delayedtick() else - GLOB.processing_objects.Remove(src) + STOP_PROCESSING(SSobj, src) #define APPLY_CORNER_AMBIENT(C) \ . = 1; \ diff --git a/code/modules/mining/drilling/drill.dm b/code/modules/mining/drilling/drill.dm index 46f3e177685f4..4279d1efde5a7 100644 --- a/code/modules/mining/drilling/drill.dm +++ b/code/modules/mining/drilling/drill.dm @@ -56,7 +56,7 @@ RefreshParts() -/obj/machinery/mining/drill/process() +/obj/machinery/mining/drill/Process() if(need_player_check) return diff --git a/code/modules/mining/lift.dm b/code/modules/mining/lift.dm index fb2f9173d3d62..69129b60a5c87 100644 --- a/code/modules/mining/lift.dm +++ b/code/modules/mining/lift.dm @@ -9,7 +9,7 @@ /obj/machinery/mine_lift/New() . = ..() - GLOB.processing_objects.Remove(src) + STOP_PROCESSING(SSobj, src) /obj/machinery/mine_lift/attack_hand(mob/user) if(isliving(user)) @@ -36,9 +36,9 @@ icon_state = new_icon_state if(icon_state == "chute_active") - GLOB.processing_objects.Add(src) + START_PROCESSING(SSobj, src) else - GLOB.processing_objects.Remove(src) + STOP_PROCESSING(SSobj, src) update_target_lift(icon_state, dir) @@ -62,7 +62,7 @@ return null -/obj/machinery/mine_lift/process() +/obj/machinery/mine_lift/Process() if(icon_state == "chute_active") if(target_lift) for(var/obj/O in src.loc) diff --git a/code/modules/mining/machine_processing.dm b/code/modules/mining/machine_processing.dm index 1693f652013ee..eb02c010841d5 100644 --- a/code/modules/mining/machine_processing.dm +++ b/code/modules/mining/machine_processing.dm @@ -155,7 +155,7 @@ return return -/obj/machinery/mineral/processing_unit/process() +/obj/machinery/mineral/processing_unit/Process() if (!src.output || !src.input) return diff --git a/code/modules/mining/machine_stacking.dm b/code/modules/mining/machine_stacking.dm index 3dd0614cfddfb..2f1bf5c979bd0 100644 --- a/code/modules/mining/machine_stacking.dm +++ b/code/modules/mining/machine_stacking.dm @@ -93,7 +93,7 @@ return return -/obj/machinery/mineral/stacking_machine/process() +/obj/machinery/mineral/stacking_machine/Process() if (src.output && src.input) for(var/obj/item/O in loading) if(istype(O, /obj/item/stack/material)) diff --git a/code/modules/mining/machine_unloading.dm b/code/modules/mining/machine_unloading.dm index 9b4d982c50ed3..bd067827a6085 100644 --- a/code/modules/mining/machine_unloading.dm +++ b/code/modules/mining/machine_unloading.dm @@ -24,7 +24,7 @@ return return -/obj/machinery/mineral/unloading_machine/process() +/obj/machinery/mineral/unloading_machine/Process() if (src.output && src.input) if (locate(/obj/structure/ore_box, input.loc)) var/obj/structure/ore_box/BOX = locate(/obj/structure/ore_box, input.loc) diff --git a/code/modules/mob/grab/grab_datum.dm b/code/modules/mob/grab/grab_datum.dm index 60feca7366285..82c8da92fcca0 100644 --- a/code/modules/mob/grab/grab_datum.dm +++ b/code/modules/mob/grab/grab_datum.dm @@ -98,7 +98,7 @@ G.force_drop() let_go_effect(G) -/datum/grab/proc/process(var/obj/item/grab/G) +/datum/grab/Process(var/obj/item/grab/G) var/diff_zone = G.target_change() if(diff_zone && G.special_target_functional) special_target_change(G, diff_zone) diff --git a/code/modules/mob/grab/grab_object.dm b/code/modules/mob/grab/grab_object.dm index eb6986e19aaf9..05cc6c44aa0e0 100644 --- a/code/modules/mob/grab/grab_object.dm +++ b/code/modules/mob/grab/grab_object.dm @@ -33,8 +33,8 @@ if(start_grab_name != NORM_PASSIVE) last_upgrade = world.time -/obj/item/grab/process() - current_grab.process(src) +/obj/item/grab/Process() + current_grab.Process(src) /obj/item/grab/attack_self(mob/user) switch(assailant.a_intent) diff --git a/code/modules/mob/hear_say.dm b/code/modules/mob/hear_say.dm index 598fc33412e31..a04cb643edf04 100644 --- a/code/modules/mob/hear_say.dm +++ b/code/modules/mob/hear_say.dm @@ -156,7 +156,7 @@ var/mob/living/carbon/human/I = impersonated[speaker_name] if(!I) - for(var/mob/living/carbon/human/M in GLOB.mob_list) + for(var/mob/living/carbon/human/M in SSmobs.mob_list) if(M.real_name == speaker_name) I = M impersonated[speaker_name] = I diff --git a/code/modules/mob/holder.dm b/code/modules/mob/holder.dm index a4b834fd08d0e..2fb8249a8526b 100644 --- a/code/modules/mob/holder.dm +++ b/code/modules/mob/holder.dm @@ -22,7 +22,7 @@ var/list/holder_mob_icon_cache = list() /obj/item/weapon/holder/New() ..() - GLOB.processing_objects.Add(src) + START_PROCESSING(SSobj, src) /obj/item/weapon/holder/proc/destroy_all() for(var/atom/movable/AM in src) @@ -33,10 +33,10 @@ var/list/holder_mob_icon_cache = list() for(var/atom/movable/AM in src) AM.forceMove(get_turf(src)) last_holder = null - GLOB.processing_objects.Remove(src) + STOP_PROCESSING(SSobj, src) return ..() -/obj/item/weapon/holder/process() +/obj/item/weapon/holder/Process() update_state() /obj/item/weapon/holder/dropped() diff --git a/code/modules/mob/living/carbon/human/human_organs.dm b/code/modules/mob/living/carbon/human/human_organs.dm index 6d0b2a67fe79e..c70d6e4d0dc07 100644 --- a/code/modules/mob/living/carbon/human/human_organs.dm +++ b/code/modules/mob/living/carbon/human/human_organs.dm @@ -34,7 +34,7 @@ //processing internal organs is pretty cheap, do that first. for(var/obj/item/organ/I in internal_organs) - I.process() + I.Process() handle_stance() handle_grasp() @@ -49,7 +49,7 @@ bad_external_organs -= E continue else - E.process() + E.Process() if (!lying && !buckled && world.time - l_move_time < 15) //Moving around with fractured ribs won't do you any good diff --git a/code/modules/mob/living/carbon/viruses.dm b/code/modules/mob/living/carbon/viruses.dm index 8584e5d24e261..056118b9cded2 100644 --- a/code/modules/mob/living/carbon/viruses.dm +++ b/code/modules/mob/living/carbon/viruses.dm @@ -35,7 +35,7 @@ if(isnull(V)) // Trying to figure out a runtime error that keeps repeating CRASH("virus2 nulled before calling activate()") else - V.process(src) + V.Process(src) // activate may have deleted the virus if(!V) continue diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm index 8190e764dbff9..bb6630bae3590 100644 --- a/code/modules/mob/living/silicon/ai/ai.dm +++ b/code/modules/mob/living/silicon/ai/ai.dm @@ -581,7 +581,7 @@ var/list/ai_verbs_default = list( to_chat(src, "Unable to locate the holopad.") if (href_list["track"]) - var/mob/target = locate(href_list["track"]) in GLOB.mob_list + var/mob/target = locate(href_list["track"]) in SSmobs.mob_list var/mob/living/carbon/human/H = target if(!istype(H) || (html_decode(href_list["trackname"]) == H.get_visible_name()) || (html_decode(href_list["trackname"]) == H.get_id_name())) diff --git a/code/modules/mob/living/silicon/ai/login.dm b/code/modules/mob/living/silicon/ai/login.dm index b1938a4b18335..84c2ea8480a76 100644 --- a/code/modules/mob/living/silicon/ai/login.dm +++ b/code/modules/mob/living/silicon/ai/login.dm @@ -2,7 +2,7 @@ ..() if(stat != DEAD) switch_to_net_by_name(network) - for(var/obj/machinery/ai_status_display/O in GLOB.machines) //change status + for(var/obj/machinery/ai_status_display/O in SSmachines.machinery) //change status O.mode = 1 O.emotion = "Neutral" diff --git a/code/modules/mob/living/silicon/robot/drone/drone_manufacturer.dm b/code/modules/mob/living/silicon/robot/drone/drone_manufacturer.dm index 90332001e9500..06105f85721dc 100644 --- a/code/modules/mob/living/silicon/robot/drone/drone_manufacturer.dm +++ b/code/modules/mob/living/silicon/robot/drone/drone_manufacturer.dm @@ -38,7 +38,7 @@ if (stat & NOPOWER) icon_state = "drone_fab_nopower" -/obj/machinery/drone_fabricator/process() +/obj/machinery/drone_fabricator/Process() if(ticker.current_state < GAME_STATE_PLAYING) return @@ -117,7 +117,7 @@ if(!fabricator) var/list/all_fabricators = list() - for(var/obj/machinery/drone_fabricator/DF in GLOB.machines) + for(var/obj/machinery/drone_fabricator/DF in SSmachines.machinery) if((DF.stat & NOPOWER) || !DF.produce_drones || DF.drone_progress < 100) continue all_fabricators[DF.fabricator_tag] = DF diff --git a/code/modules/mob/living/silicon/robot/robot_items.dm b/code/modules/mob/living/silicon/robot/robot_items.dm index 01665a09470bb..c378047289756 100644 --- a/code/modules/mob/living/silicon/robot/robot_items.dm +++ b/code/modules/mob/living/silicon/robot/robot_items.dm @@ -54,7 +54,7 @@ to_chat(user, "The [src] is empty. Put something inside it first.") if(response == "Sync") var/success = 0 - for(var/obj/machinery/r_n_d/server/S in GLOB.machines) + for(var/obj/machinery/r_n_d/server/S in SSmachines.machinery) for(var/datum/tech/T in files.known_tech) //Uploading S.files.AddTech2Known(T) for(var/datum/tech/T in S.files.known_tech) //Downloading diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index 67a9c6c50af90..43629f032aa20 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -326,7 +326,7 @@ It's fairly easy to fix if dealing with single letters but not so much with comp /proc/findname(msg) - for(var/mob/M in GLOB.mob_list) + for(var/mob/M in SSmobs.mob_list) if (M.real_name == text("[msg]")) return 1 return 0 @@ -409,7 +409,7 @@ proc/is_blind(A) /proc/mobs_in_area(var/area/A) var/list/mobs = new - for(var/mob/living/M in GLOB.mob_list) + for(var/mob/living/M in SSmobs.mob_list) if(get_area(M) == A) mobs += M return mobs diff --git a/code/modules/mob/observer/ghost/ghost.dm b/code/modules/mob/observer/ghost/ghost.dm index 488da777f323c..099b407698488 100644 --- a/code/modules/mob/observer/ghost/ghost.dm +++ b/code/modules/mob/observer/ghost/ghost.dm @@ -94,7 +94,7 @@ var/global/list/image/ghost_sightless_images = list() //this is a list of images /mob/observer/ghost/Topic(href, href_list) if (href_list["track"]) if(istype(href_list["track"],/mob)) - var/mob/target = locate(href_list["track"]) in GLOB.mob_list + var/mob/target = locate(href_list["track"]) in SSmobs.mob_list if(target) ManualFollow(target) else diff --git a/code/modules/modular_computers/NTNet/NTNet.dm b/code/modules/modular_computers/NTNet/NTNet.dm index 6ca12fe0f7095..1e78f690a76d5 100644 --- a/code/modules/modular_computers/NTNet/NTNet.dm +++ b/code/modules/modular_computers/NTNet/NTNet.dm @@ -31,7 +31,7 @@ var/global/datum/ntnet/ntnet_global = new() /datum/ntnet/New() if(ntnet_global && (ntnet_global != src)) ntnet_global = src // There can be only one. - for(var/obj/machinery/ntnet_relay/R in GLOB.machines) + for(var/obj/machinery/ntnet_relay/R in SSmachines.machinery) relays.Add(R) R.NTNet = src build_software_lists() diff --git a/code/modules/modular_computers/NTNet/NTNet_relay.dm b/code/modules/modular_computers/NTNet/NTNet_relay.dm index 183f5c4be60ed..e6027944352ca 100644 --- a/code/modules/modular_computers/NTNet/NTNet_relay.dm +++ b/code/modules/modular_computers/NTNet/NTNet_relay.dm @@ -35,7 +35,7 @@ else icon_state = "bus_off" -/obj/machinery/ntnet_relay/process() +/obj/machinery/ntnet_relay/Process() if(operable()) use_power = 2 else diff --git a/code/modules/modular_computers/computers/modular_computer/core.dm b/code/modules/modular_computers/computers/modular_computer/core.dm index 1440ac324d0b6..1823afca6811d 100644 --- a/code/modules/modular_computers/computers/modular_computer/core.dm +++ b/code/modules/modular_computers/computers/modular_computer/core.dm @@ -1,4 +1,4 @@ -/obj/item/modular_computer/process() +/obj/item/modular_computer/Process() if(!enabled) // The computer is turned off last_power_usage = 0 return 0 @@ -42,7 +42,7 @@ return 1 /obj/item/modular_computer/New() - GLOB.processing_objects.Add(src) + START_PROCESSING(SSobj, src) install_default_hardware() if(hard_drive) install_default_programs() @@ -52,7 +52,7 @@ /obj/item/modular_computer/Destroy() kill_program(1) - GLOB.processing_objects.Remove(src) + STOP_PROCESSING(SSobj, src) for(var/obj/item/weapon/computer_hardware/CH in src.get_all_components()) uninstall_component(null, CH) qdel(CH) diff --git a/code/modules/modular_computers/file_system/programs/command/comm.dm b/code/modules/modular_computers/file_system/programs/command/comm.dm index b962ae093e394..0fefef7d69251 100644 --- a/code/modules/modular_computers/file_system/programs/command/comm.dm +++ b/code/modules/modular_computers/file_system/programs/command/comm.dm @@ -319,7 +319,7 @@ var/last_message_id = 0 /proc/is_relay_online() - for(var/obj/machinery/bluespacerelay/M in GLOB.machines) + for(var/obj/machinery/bluespacerelay/M in SSmachines.machinery) if(M.stat == 0) return 1 return 0 diff --git a/code/modules/modular_computers/file_system/programs/engineering/atmos_control.dm b/code/modules/modular_computers/file_system/programs/engineering/atmos_control.dm index ba9b9035ca6bd..e711c8e390741 100644 --- a/code/modules/modular_computers/file_system/programs/engineering/atmos_control.dm +++ b/code/modules/modular_computers/file_system/programs/engineering/atmos_control.dm @@ -32,7 +32,7 @@ log_debug("\The [src] given an unepxected req_one_access: [req_one_access]") if(monitored_alarm_ids) - for(var/obj/machinery/alarm/alarm in GLOB.machines) + for(var/obj/machinery/alarm/alarm in SSmachines.machinery) if(alarm.alarm_id && alarm.alarm_id in monitored_alarm_ids) monitored_alarms += alarm // machines may not yet be ordered at this point @@ -44,7 +44,7 @@ if(href_list["alarm"]) if(ui_ref) - var/obj/machinery/alarm/alarm = locate(href_list["alarm"]) in (monitored_alarms.len ? monitored_alarms : GLOB.machines) + var/obj/machinery/alarm/alarm = locate(href_list["alarm"]) in (monitored_alarms.len ? monitored_alarms : SSmachines.machinery) if(alarm) var/datum/topic_state/TS = generate_state(alarm) alarm.ui_interact(usr, master_ui = ui_ref, state = TS) @@ -55,7 +55,7 @@ var/alarms[0] // TODO: Move these to a cache, similar to cameras - for(var/obj/machinery/alarm/alarm in (monitored_alarms.len ? monitored_alarms : GLOB.machines)) + for(var/obj/machinery/alarm/alarm in (monitored_alarms.len ? monitored_alarms : SSmachines.machinery)) alarms[++alarms.len] = list("name" = sanitize(alarm.name), "ref"= "\ref[alarm]", "danger" = max(alarm.danger_level, alarm.alarm_area.atmosalm)) data["alarms"] = alarms diff --git a/code/modules/modular_computers/file_system/programs/engineering/power_monitor.dm b/code/modules/modular_computers/file_system/programs/engineering/power_monitor.dm index 2184550bc22ca..6ae5ab25dc245 100644 --- a/code/modules/modular_computers/file_system/programs/engineering/power_monitor.dm +++ b/code/modules/modular_computers/file_system/programs/engineering/power_monitor.dm @@ -87,7 +87,7 @@ if(!T) // Safety check return var/connected_z_levels = GetConnectedZlevels(T.z) - for(var/obj/machinery/power/sensor/S in GLOB.machines) + for(var/obj/machinery/power/sensor/S in SSmachines.machinery) if((S.long_range) || (S.loc.z in connected_z_levels)) // Consoles have range on their Z-Level. Sensors with long_range var will work between Z levels. if(S.name_tag == "#UNKN#") // Default name. Shouldn't happen! warning("Powernet sensor with unset ID Tag! [S.x]X [S.y]Y [S.z]Z") diff --git a/code/modules/modular_computers/file_system/programs/engineering/rcon_console.dm b/code/modules/modular_computers/file_system/programs/engineering/rcon_console.dm index f94038d1afcb7..c555107bed458 100644 --- a/code/modules/modular_computers/file_system/programs/engineering/rcon_console.dm +++ b/code/modules/modular_computers/file_system/programs/engineering/rcon_console.dm @@ -120,11 +120,11 @@ // Description: Refreshes local list of known devices. /datum/nano_module/rcon/proc/FindDevices() known_SMESs = new /list() - for(var/obj/machinery/power/smes/buildable/SMES in GLOB.machines) + for(var/obj/machinery/power/smes/buildable/SMES in SSmachines.machinery) if(SMES.RCon_tag && (SMES.RCon_tag != "NO_TAG") && SMES.RCon) known_SMESs.Add(SMES) known_breakers = new /list() - for(var/obj/machinery/power/breakerbox/breaker in GLOB.machines) + for(var/obj/machinery/power/breakerbox/breaker in SSmachines.machinery) if(breaker.RCon_tag != "NO_TAG") known_breakers.Add(breaker) diff --git a/code/modules/modular_computers/file_system/programs/engineering/supermatter_monitor.dm b/code/modules/modular_computers/file_system/programs/engineering/supermatter_monitor.dm index 5bdf77e5cb537..83d640698b04f 100644 --- a/code/modules/modular_computers/file_system/programs/engineering/supermatter_monitor.dm +++ b/code/modules/modular_computers/file_system/programs/engineering/supermatter_monitor.dm @@ -43,7 +43,7 @@ if(!T) return var/valid_z_levels = (GetConnectedZlevels(T.z) & GLOB.using_map.station_levels) - for(var/obj/machinery/power/supermatter/S in GLOB.machines) + for(var/obj/machinery/power/supermatter/S in SSmachines.machinery) // Delaminating, not within coverage, not on a tile. if(S.grav_pulling || S.exploded || !(S.z in valid_z_levels) || !istype(S.loc, /turf/)) continue diff --git a/code/modules/modular_computers/file_system/programs/medical/suit_sensors.dm b/code/modules/modular_computers/file_system/programs/medical/suit_sensors.dm index e1531f389b5b0..d161f397cf76e 100644 --- a/code/modules/modular_computers/file_system/programs/medical/suit_sensors.dm +++ b/code/modules/modular_computers/file_system/programs/medical/suit_sensors.dm @@ -32,13 +32,13 @@ if(href_list["track"]) if(isAI(usr)) var/mob/living/silicon/ai/AI = usr - var/mob/living/carbon/human/H = locate(href_list["track"]) in GLOB.mob_list + var/mob/living/carbon/human/H = locate(href_list["track"]) in SSmobs.mob_list if(hassensorlevel(H, SUIT_SENSOR_TRACKING)) AI.ai_actual_track(H) return 1 if(href_list["view_cam"]) - var/mob/living/carbon/human/H = locate(href_list["view_cam"]) in GLOB.mob_list + var/mob/living/carbon/human/H = locate(href_list["view_cam"]) in SSmobs.mob_list view_camera(usr, H) if(href_list["stop_cam"]) diff --git a/code/modules/multiz/pipes.dm b/code/modules/multiz/pipes.dm index 1d08e48561e94..9efbf76783e9c 100644 --- a/code/modules/multiz/pipes.dm +++ b/code/modules/multiz/pipes.dm @@ -48,7 +48,7 @@ obj/machinery/atmospherics/pipe/zpipe/New() invisibility = i ? 101 : 0 update_icon() -obj/machinery/atmospherics/pipe/zpipe/process() +obj/machinery/atmospherics/pipe/zpipe/Process() if(!parent) //This should cut back on the overhead calling build_network thousands of times per cycle ..() else diff --git a/code/modules/organs/external/_external.dm b/code/modules/organs/external/_external.dm index afa2ed7bb6d38..567c1a05d0699 100644 --- a/code/modules/organs/external/_external.dm +++ b/code/modules/organs/external/_external.dm @@ -490,7 +490,7 @@ This function completely restores a damaged organ to perfect condition. return 1 return 0 -/obj/item/organ/external/process() +/obj/item/organ/external/Process() if(owner) if(pain) diff --git a/code/modules/organs/external/machine.dm b/code/modules/organs/external/machine.dm index b28e5bc25c45b..7cb469a6920d0 100644 --- a/code/modules/organs/external/machine.dm +++ b/code/modules/organs/external/machine.dm @@ -38,7 +38,7 @@ cell.use(amount) return 1 -/obj/item/organ/internal/cell/process() +/obj/item/organ/internal/cell/Process() ..() if(!owner) return diff --git a/code/modules/organs/internal/_internal.dm b/code/modules/organs/internal/_internal.dm index f427145816ad8..6713e68ccb7d6 100644 --- a/code/modules/organs/internal/_internal.dm +++ b/code/modules/organs/internal/_internal.dm @@ -47,7 +47,7 @@ ..() - GLOB.processing_objects -= src + STOP_PROCESSING(SSobj, src) target.internal_organs |= src affected.internal_organs |= src target.internal_organs_by_name[organ_tag] = src diff --git a/code/modules/organs/internal/appendix.dm b/code/modules/organs/internal/appendix.dm index df961564dd88a..e5246c809a299 100644 --- a/code/modules/organs/internal/appendix.dm +++ b/code/modules/organs/internal/appendix.dm @@ -11,7 +11,7 @@ icon_state = "appendixinflamed" name = "inflamed appendix" -/obj/item/organ/internal/appendix/process() +/obj/item/organ/internal/appendix/Process() ..() if(inflamed && owner) inflamed++ diff --git a/code/modules/organs/internal/borer.dm b/code/modules/organs/internal/borer.dm index bfcf43b442d8b..974a135c1c267 100644 --- a/code/modules/organs/internal/borer.dm +++ b/code/modules/organs/internal/borer.dm @@ -8,7 +8,7 @@ parent_organ = BP_HEAD vital = 1 -/obj/item/organ/internal/borer/process() +/obj/item/organ/internal/borer/Process() // Borer husks regenerate health, feel no pain, and are resistant to stuns and brainloss. for(var/chem_name in GLOB.borer_reagent_types_by_name) diff --git a/code/modules/organs/internal/brain.dm b/code/modules/organs/internal/brain.dm index 8b7106b2638fe..e2978050fe549 100644 --- a/code/modules/organs/internal/brain.dm +++ b/code/modules/organs/internal/brain.dm @@ -133,7 +133,7 @@ /obj/item/organ/internal/brain/proc/past_damage_threshold(var/threshold) return (get_current_damage_threshold() > threshold) -/obj/item/organ/internal/brain/process() +/obj/item/organ/internal/brain/Process() if(owner) if(damage > max_damage / 2 && healed_threshold) diff --git a/code/modules/organs/internal/eyes.dm b/code/modules/organs/internal/eyes.dm index e73383d915870..1abc9f85be2eb 100644 --- a/code/modules/organs/internal/eyes.dm +++ b/code/modules/organs/internal/eyes.dm @@ -60,7 +60,7 @@ if(is_broken() && !oldbroken && owner && !owner.stat) to_chat(owner, "You go blind!") -/obj/item/organ/internal/eyes/process() //Eye damage replaces the old eye_stat var. +/obj/item/organ/internal/eyes/Process() //Eye damage replaces the old eye_stat var. ..() if(!owner) return diff --git a/code/modules/organs/internal/heart.dm b/code/modules/organs/internal/heart.dm index a6249ce6fb063..3382b4fced65d 100644 --- a/code/modules/organs/internal/heart.dm +++ b/code/modules/organs/internal/heart.dm @@ -27,7 +27,7 @@ var/const/BLOOD_VOLUME_SURVIVE = 40 . = ..() icon_state = "heart-prosthetic" -/obj/item/organ/internal/heart/process() +/obj/item/organ/internal/heart/Process() if(owner) handle_pulse() if(pulse) diff --git a/code/modules/organs/internal/kidneys.dm b/code/modules/organs/internal/kidneys.dm index 62dd96a77cead..55b2e00914823 100644 --- a/code/modules/organs/internal/kidneys.dm +++ b/code/modules/organs/internal/kidneys.dm @@ -12,7 +12,7 @@ . = ..() icon_state = "kidneys-prosthetic" -/obj/item/organ/internal/kidneys/process() +/obj/item/organ/internal/kidneys/Process() ..() diff --git a/code/modules/organs/internal/liver.dm b/code/modules/organs/internal/liver.dm index a1e5a1e33867a..7a19562295858 100644 --- a/code/modules/organs/internal/liver.dm +++ b/code/modules/organs/internal/liver.dm @@ -16,7 +16,7 @@ . = ..() icon_state = "liver-prosthetic" -/obj/item/organ/internal/liver/process() +/obj/item/organ/internal/liver/Process() ..() if(!owner) diff --git a/code/modules/organs/internal/lungs.dm b/code/modules/organs/internal/lungs.dm index 248fd534e4406..74dec66821eb0 100644 --- a/code/modules/organs/internal/lungs.dm +++ b/code/modules/organs/internal/lungs.dm @@ -72,7 +72,7 @@ poison_gases = species.poison_gases exhale_type = species.exhale_type ? species.exhale_type : "carbon_dioxide" -/obj/item/organ/internal/lungs/process() +/obj/item/organ/internal/lungs/Process() ..() if(!owner) return diff --git a/code/modules/organs/organ.dm b/code/modules/organs/organ.dm index 4d0f41b006f08..eca25e2576d10 100644 --- a/code/modules/organs/organ.dm +++ b/code/modules/organs/organ.dm @@ -85,12 +85,12 @@ var/list/organ_cache = list() /obj/item/organ/proc/die() damage = max_damage status |= ORGAN_DEAD - GLOB.processing_objects -= src + STOP_PROCESSING(SSobj, src) death_time = world.time if(owner && vital) owner.death() -/obj/item/organ/process() +/obj/item/organ/Process() if(loc != owner) owner = null @@ -326,7 +326,7 @@ var/list/organ_cache = list() if(drop_organ) dropInto(owner.loc) - GLOB.processing_objects |= src + START_PROCESSING(SSobj, src) rejecting = null if(robotic < ORGAN_ROBOT) var/datum/reagent/blood/organ_blood = locate(/datum/reagent/blood) in reagents.reagent_list //TODO fix this and all other occurences of locate(/datum/reagent/blood) horror diff --git a/code/modules/organs/subtypes/nabber.dm b/code/modules/organs/subtypes/nabber.dm index 9e2616c1f2a2a..afb515aca0c7a 100644 --- a/code/modules/organs/subtypes/nabber.dm +++ b/code/modules/organs/subtypes/nabber.dm @@ -44,10 +44,10 @@ to_chat(owner, "Your protective lenses retract out of the way.") innate_flash_protection = FLASH_PROTECTION_VULNERABLE owner.eye_blind = min(2, owner.eye_blind) - process() + Process() owner.update_icons() -/obj/item/organ/internal/eyes/nabber/process() +/obj/item/organ/internal/eyes/nabber/Process() if(eyes_shielded) owner.eye_blind = 20 ..() @@ -60,7 +60,7 @@ var/dexalin_level = 10 var/phoron_level = 0.5 -/obj/item/organ/internal/phoron/process() +/obj/item/organ/internal/phoron/Process() var amount = 0.1 if(is_broken()) amount *= 0.5 @@ -78,7 +78,7 @@ name = "acetone reactor" var/acetone_level = 20 -/obj/item/organ/internal/liver/nabber/process() +/obj/item/organ/internal/liver/nabber/Process() var amount = 0.8 if(is_broken()) amount *= 0.5 @@ -130,7 +130,7 @@ parent_organ = BP_CHEST -/obj/item/organ/internal/brain/nabber/process() +/obj/item/organ/internal/brain/nabber/Process() if(!owner || !owner.should_have_organ(BP_HEART)) return diff --git a/code/modules/overmap/exoplanets/exoplanet.dm b/code/modules/overmap/exoplanets/exoplanet.dm index a93c9b1265a62..8f59d0c6e9e25 100644 --- a/code/modules/overmap/exoplanets/exoplanet.dm +++ b/code/modules/overmap/exoplanets/exoplanet.dm @@ -34,14 +34,14 @@ generate_map() generate_landing() update_biome() - GLOB.processing_objects += src + START_PROCESSING(SSobj, src) //Not that it should ever get deleted but just in case /obj/effect/overmap/sector/exoplanet/Destroy() . = ..() - GLOB.processing_objects -= src + STOP_PROCESSING(SSobj, src) -/obj/effect/overmap/sector/exoplanet/process() +/obj/effect/overmap/sector/exoplanet/Process() if(!atmosphere) return for(var/zlevel in map_z) diff --git a/code/modules/overmap/sectors.dm b/code/modules/overmap/sectors.dm index 9724023598016..e2750b4cceb96 100644 --- a/code/modules/overmap/sectors.dm +++ b/code/modules/overmap/sectors.dm @@ -337,7 +337,7 @@ var/list/points_of_interest = list() if(superstructure_strength <= SUPERSTRUCTURE_FAIL_PERCENT) pre_superstructure_failing() -/obj/effect/overmap/process() +/obj/effect/overmap/Process() for(var/e in active_effects) var/datum/overmap_effect/effect = e if(effect && !effect.process_effect()) @@ -361,8 +361,8 @@ var/list/points_of_interest = list() /obj/effect/overmap/sector/Initialize() . = ..() - GLOB.processing_objects += src - for(var/obj/machinery/computer/helm/H in GLOB.machines) + START_PROCESSING(SSobj, src) + for(var/obj/machinery/computer/helm/H in SSmachines.machinery) H.get_known_sectors() if(base) GLOB.om_base_sectors += src diff --git a/code/modules/overmap/ships/computers/helm.dm b/code/modules/overmap/ships/computers/helm.dm index 049256f19da31..5cfa2e2ef2a85 100644 --- a/code/modules/overmap/ships/computers/helm.dm +++ b/code/modules/overmap/ships/computers/helm.dm @@ -34,7 +34,7 @@ known_sectors[S.name] = R ..() -/obj/machinery/computer/helm/process() +/obj/machinery/computer/helm/Process() if(!linked) linked = map_sectors["[z]"] if(..()) diff --git a/code/modules/overmap/ships/engines/engine.dm b/code/modules/overmap/ships/engines/engine.dm index d3e68bc386ccf..b2bb7b6b5ea01 100644 --- a/code/modules/overmap/ships/engines/engine.dm +++ b/code/modules/overmap/ships/engines/engine.dm @@ -8,14 +8,14 @@ var/list/ship_engines = list() /datum/ship_engine/New(var/obj/machinery/_holder) . = ..() holder = _holder - GLOB.processing_objects += src + START_PROCESSING(SSobj, src) -/datum/ship_engine/proc/process() +/datum/ship_engine/Process() ship_engines += src var/obj/effect/overmap/ship/S = map_sectors["[holder.z]"] if(istype(S)) S.engines |= src - GLOB.processing_objects -= src + STOP_PROCESSING(SSobj, src) /datum/ship_engine/proc/can_burn() return 0 diff --git a/code/modules/overmap/ships/ship.dm b/code/modules/overmap/ships/ship.dm index cd4029a6229f5..0f374cc6b6e25 100644 --- a/code/modules/overmap/ships/ship.dm +++ b/code/modules/overmap/ships/ship.dm @@ -38,21 +38,21 @@ for(var/datum/ship_engine/E in ship_engines) if (E.holder.z in map_z) engines |= E - for(var/obj/machinery/computer/engines/E in GLOB.machines) + for(var/obj/machinery/computer/engines/E in SSmachines.machinery) if (E.z in map_z) E.linked = src testing("Engines console at level [E.z] linked to overmap object '[name]'.") - for(var/obj/machinery/computer/helm/H in GLOB.machines) + for(var/obj/machinery/computer/helm/H in SSmachines.machinery) if (H.z in map_z) nav_control = H H.linked = src H.get_known_sectors() testing("Helm console at level [H.z] linked to overmap object '[name]'.") - for(var/obj/machinery/computer/navigation/N in GLOB.machines) + for(var/obj/machinery/computer/navigation/N in SSmachines.machinery) if (N.z in map_z) N.linked = src testing("Navigation console at level [N.z] linked to overmap object '[name]'.") - GLOB.processing_objects.Add(src) + START_PROCESSING(SSobj, src) my_pixel_transform = init_pixel_transform(src) my_pixel_transform.max_pixel_speed = ship_max_speed @@ -251,7 +251,7 @@ adjust_speed(0, -get_burn_acceleration()) */ -/obj/effect/overmap/ship/process() +/obj/effect/overmap/ship/Process() . = ..() if(moving_dir) accelerate(moving_dir) diff --git a/code/modules/power/antimatter/control.dm b/code/modules/power/antimatter/control.dm index 6f9e4b5d0348e..b4608142a22a6 100644 --- a/code/modules/power/antimatter/control.dm +++ b/code/modules/power/antimatter/control.dm @@ -41,7 +41,7 @@ ..() -/obj/machinery/power/am_control_unit/process() +/obj/machinery/power/am_control_unit/Process() if(exploding) explosion(get_turf(src),8,12,18,12) if(src) qdel(src) diff --git a/code/modules/power/antimatter/fuel.dm b/code/modules/power/antimatter/fuel.dm index e4a0388c3fa94..df4d4b2b0402f 100644 --- a/code/modules/power/antimatter/fuel.dm +++ b/code/modules/power/antimatter/fuel.dm @@ -92,7 +92,7 @@ O.place = "fuel" M.requests += O spawn( 0 ) - O.process() + O.Process() return else for(var/mob/O in viewers(M, null)) diff --git a/code/modules/power/antimatter/shielding.dm b/code/modules/power/antimatter/shielding.dm index 579677e0ae239..bfc5230768f5d 100644 --- a/code/modules/power/antimatter/shielding.dm +++ b/code/modules/power/antimatter/shielding.dm @@ -79,7 +79,7 @@ proc/cardinalrange(var/center) return 0 -/obj/machinery/am_shielding/process() +/obj/machinery/am_shielding/Process() if(!processing) . = PROCESS_KILL //TODO: core functions and stability //TODO: think about checking the airmix for phoron and increasing power output @@ -151,7 +151,7 @@ proc/cardinalrange(var/center) /obj/machinery/am_shielding/proc/setup_core() processing = 1 - GLOB.machines.Add(src) + SSmachines.machinery.Add(src) if(!control_unit) return control_unit.linked_cores.Add(src) control_unit.reported_core_efficiency += efficiency diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm index 316830f217699..15620834aa64e 100644 --- a/code/modules/power/apc.dm +++ b/code/modules/power/apc.dm @@ -989,7 +989,7 @@ else return 0 -/obj/machinery/power/apc/process() +/obj/machinery/power/apc/Process() if(stat & (BROKEN|MAINT)) return diff --git a/code/modules/power/batteryrack.dm b/code/modules/power/batteryrack.dm index 839986348862b..884bf71391f38 100644 --- a/code/modules/power/batteryrack.dm +++ b/code/modules/power/batteryrack.dm @@ -172,7 +172,7 @@ return 1 -/obj/machinery/power/smes/batteryrack/process() +/obj/machinery/power/smes/batteryrack/Process() charge = 0 for(var/obj/item/weapon/cell/C in internal_cells) charge += C.charge diff --git a/code/modules/power/breaker_box.dm b/code/modules/power/breaker_box.dm index 32122cb8a7886..e2e6ca649d1d0 100644 --- a/code/modules/power/breaker_box.dm +++ b/code/modules/power/breaker_box.dm @@ -134,5 +134,5 @@ spawn(600) update_locked = 0 -/obj/machinery/power/breakerbox/process() +/obj/machinery/power/breakerbox/Process() return 1 \ No newline at end of file diff --git a/code/modules/power/cable_logic.dm b/code/modules/power/cable_logic.dm index 3b5b67a3ea4f1..84080bf867e04 100644 --- a/code/modules/power/cable_logic.dm +++ b/code/modules/power/cable_logic.dm @@ -5,7 +5,7 @@ //Input is searched from the 'dir' direction var/obj/structure/cable/input -/obj/machinery/logic/indicator/process() +/obj/machinery/logic/indicator/Process() if(input) return 1 @@ -25,7 +25,7 @@ icon = 'icons/obj/lighting.dmi' icon_state = "bulb0" -/obj/machinery/logic/indicator/bulb/process() +/obj/machinery/logic/indicator/bulb/Process() if(!..()) //Parent proc checks if input1 exists. return @@ -46,7 +46,7 @@ //Output is searched from the 'dir' direction var/obj/structure/cable/output -/obj/machinery/logic/sensor/process() +/obj/machinery/logic/sensor/Process() if(output) return 1 @@ -66,7 +66,7 @@ icon = 'icons/obj/atmospherics/outlet_injector.dmi' icon_state = "off" -/obj/machinery/logic/sensor/constant_high/process() +/obj/machinery/logic/sensor/constant_high/Process() if(!..()) //Parent proc checks if input1 exists. return @@ -88,7 +88,7 @@ icon = 'icons/atmos/heat.dmi' icon_state = "intact" -/obj/machinery/logic/oneinput/process() +/obj/machinery/logic/oneinput/Process() if(input && output) return 1 @@ -114,7 +114,7 @@ return 0 //On the process() call, where everything is still being searched for, it returns 0. It will return 1 on the next process() call. //NOT GATE -/obj/machinery/logic/oneinput/not/process() +/obj/machinery/logic/oneinput/not/Process() if(!..()) //Parent proc checks if input1, input2 and output exist. return @@ -151,7 +151,7 @@ icon = 'icons/obj/atmospherics/mixer.dmi' icon_state = "intact_off" -/obj/machinery/logic/twoinput/process() +/obj/machinery/logic/twoinput/Process() if(input1 && input2 && output) return 1 @@ -185,7 +185,7 @@ return 0 //On the process() call, where everything is still being searched for, it returns 0. It will return 1 on the next process() call. //AND GATE -/obj/machinery/logic/twoinput/and/process() +/obj/machinery/logic/twoinput/and/Process() if(!..()) //Parent proc checks if input1, input2 and output exist. return @@ -205,7 +205,7 @@ pn_output.draw_power(LOGIC_HIGH) //Otherwise increase the load to 5 //OR GATE -/obj/machinery/logic/twoinput/or/process() +/obj/machinery/logic/twoinput/or/Process() if(!..()) //Parent proc checks if input1, input2 and output exist. return @@ -225,7 +225,7 @@ pn_output.draw_power(LOGIC_HIGH) //Otherwise increase the load to 5 //XOR GATE -/obj/machinery/logic/twoinput/xor/process() +/obj/machinery/logic/twoinput/xor/Process() if(!..()) //Parent proc checks if input1, input2 and output exist. return @@ -245,7 +245,7 @@ pn_output.draw_power(LOGIC_HIGH) //Otherwise increase the load to 5 //XNOR GATE (EQUIVALENCE) -/obj/machinery/logic/twoinput/xnor/process() +/obj/machinery/logic/twoinput/xnor/Process() if(!..()) //Parent proc checks if input1, input2 and output exist. return @@ -267,7 +267,7 @@ #define RELAY_POWER_TRANSFER 2000 //How much power a relay transfers through. //RELAY - input1 governs the flow from input2 to output -/obj/machinery/logic/twoinput/relay/process() +/obj/machinery/logic/twoinput/relay/Process() if(!..()) //Parent proc checks if input1, input2 and output exist. return diff --git a/code/modules/power/debug_items.dm b/code/modules/power/debug_items.dm index 434d33702c1cb..d4b2c6ca257b1 100644 --- a/code/modules/power/debug_items.dm +++ b/code/modules/power/debug_items.dm @@ -29,7 +29,7 @@ desc = "An experimental power generator" var/power_generation_rate = 1000000 -/obj/machinery/power/debug_items/infinite_generator/process() +/obj/machinery/power/debug_items/infinite_generator/Process() add_avail(power_generation_rate) /obj/machinery/power/debug_items/infinite_generator/show_info(var/mob/user) @@ -44,7 +44,7 @@ var/power_usage_rate = 0 var/last_used = 0 -/obj/machinery/power/debug_items/infinite_cable_powersink/process() +/obj/machinery/power/debug_items/infinite_cable_powersink/Process() last_used = draw_power(power_usage_rate) /obj/machinery/power/debug_items/infinite_cable_powersink/show_info(var/mob/user) diff --git a/code/modules/power/fusion/_setup.dm b/code/modules/power/fusion/_setup.dm index b9fc5a7a9309b..283bdaffb6bd4 100644 --- a/code/modules/power/fusion/_setup.dm +++ b/code/modules/power/fusion/_setup.dm @@ -31,11 +31,11 @@ log_and_message_admins("## FUSION CORE SETUP - Setup initiated by [usr].") - for(var/obj/machinery/fusion_fuel_injector/mapped/injector in GLOB.machines) + for(var/obj/machinery/fusion_fuel_injector/mapped/injector in SSmachines.machinery) injector.cur_assembly = new /obj/item/weapon/fuel_assembly/deuterium(injector) injector.BeginInjecting() - var/obj/machinery/power/fusion_core/mapped/core = locate() in GLOB.machines + var/obj/machinery/power/fusion_core/mapped/core = locate() in SSmachines.machinery if(core.jumpstart(15000)) var/list/delayed_objects = list() diff --git a/code/modules/power/fusion/core/_core.dm b/code/modules/power/fusion/core/_core.dm index a55d1517dc6ad..9104183a21c91 100644 --- a/code/modules/power/fusion/core/_core.dm +++ b/code/modules/power/fusion/core/_core.dm @@ -31,14 +31,14 @@ var/list/fusion_cores = list() fusion_cores += src /obj/machinery/power/fusion_core/Destroy() - for(var/obj/machinery/computer/fusion_core_control/FCC in GLOB.machines) + for(var/obj/machinery/computer/fusion_core_control/FCC in SSmachines.machinery) FCC.connected_devices -= src if(FCC.cur_viewed_device == src) FCC.cur_viewed_device = null fusion_cores -= src return ..() -/obj/machinery/power/fusion_core/process() +/obj/machinery/power/fusion_core/Process() if((stat & BROKEN) || !powernet || !owned_field) Shutdown() diff --git a/code/modules/power/fusion/core/core_field.dm b/code/modules/power/fusion/core/core_field.dm index 7a3c9e75fea48..e3d9e4f44c53a 100644 --- a/code/modules/power/fusion/core/core_field.dm +++ b/code/modules/power/fusion/core/core_field.dm @@ -106,9 +106,9 @@ catcher.SetSize(7) particle_catchers.Add(catcher) - GLOB.processing_objects.Add(src) + START_PROCESSING(SSobj, src) -/obj/effect/fusion_em_field/process() +/obj/effect/fusion_em_field/Process() //make sure the field generator is still intact if(!owned_core || QDELETED(owned_core)) qdel(src) @@ -480,7 +480,7 @@ if(owned_core) owned_core.owned_field = null owned_core = null - GLOB.processing_objects.Remove(src) + STOP_PROCESSING(SSobj, src) . = ..() /obj/effect/fusion_em_field/bullet_act(var/obj/item/projectile/Proj) diff --git a/code/modules/power/fusion/fuel_assembly/fuel_assembly.dm b/code/modules/power/fusion/fuel_assembly/fuel_assembly.dm index a05b4b352a934..80d2e436af305 100644 --- a/code/modules/power/fusion/fuel_assembly/fuel_assembly.dm +++ b/code/modules/power/fusion/fuel_assembly/fuel_assembly.dm @@ -29,7 +29,7 @@ if(material.radioactivity) radioactivity = material.radioactivity desc += " It is warm to the touch." - GLOB.processing_objects += src + START_PROCESSING(SSobj, src) if(material.luminescence) set_light(material.luminescence, material.luminescence, material.icon_colour) else @@ -42,7 +42,7 @@ overlays += list(I, image(icon, "fuel_assembly_bracket")) rod_quantities[fuel_type] = initial_amount -/obj/item/weapon/fuel_assembly/process() +/obj/item/weapon/fuel_assembly/Process() if(!radioactivity) return PROCESS_KILL @@ -50,7 +50,7 @@ radiation_repository.radiate(src, max(1,ceil(radioactivity/30))) /obj/item/weapon/fuel_assembly/Destroy() - GLOB.processing_objects -= src + STOP_PROCESSING(SSobj, src) return ..() // Mapper shorthand. diff --git a/code/modules/power/fusion/fuel_assembly/fuel_injector.dm b/code/modules/power/fusion/fuel_assembly/fuel_injector.dm index ea463cdd3b602..2bf2258913fd9 100644 --- a/code/modules/power/fusion/fuel_assembly/fuel_injector.dm +++ b/code/modules/power/fusion/fuel_assembly/fuel_injector.dm @@ -31,7 +31,7 @@ var/list/fuel_injectors = list() /obj/machinery/fusion_fuel_injector/mapped anchored = 1 -/obj/machinery/fusion_fuel_injector/process() +/obj/machinery/fusion_fuel_injector/Process() if(injecting) if(stat & (BROKEN|NOPOWER)) StopInjecting() diff --git a/code/modules/power/fusion/gyrotron/gyrotron.dm b/code/modules/power/fusion/gyrotron/gyrotron.dm index ca02647bb57d4..1847497ad6221 100644 --- a/code/modules/power/fusion/gyrotron/gyrotron.dm +++ b/code/modules/power/fusion/gyrotron/gyrotron.dm @@ -29,7 +29,7 @@ var/list/gyrotrons = list() gyrotrons -= src return ..() -/obj/machinery/power/emitter/gyrotron/process() +/obj/machinery/power/emitter/gyrotron/Process() active_power_usage = mega_energy * GYRO_POWER . = ..() diff --git a/code/modules/power/generator.dm b/code/modules/power/generator.dm index 2f3a93337a4ae..b4832f6160b67 100644 --- a/code/modules/power/generator.dm +++ b/code/modules/power/generator.dm @@ -64,7 +64,7 @@ if(lastgenlev != 0) overlays += image('icons/obj/power.dmi', "teg-op[lastgenlev]") -/obj/machinery/power/generator/process() +/obj/machinery/power/generator/Process() if(!circ1 || !circ2 || !anchored || stat & (BROKEN|NOPOWER)) stored_energy = 0 return diff --git a/code/modules/power/gravitygenerator.dm b/code/modules/power/gravitygenerator.dm index 62a854d982d50..b285b15723a5e 100644 --- a/code/modules/power/gravitygenerator.dm +++ b/code/modules/power/gravitygenerator.dm @@ -105,7 +105,7 @@ for(var/area/A in gravity_generator.localareas) var/obj/machinery/gravity_generator/G - for(G in GLOB.machines) + for(G in SSmachines.machinery) if((A in G.localareas) && (G.on)) break if(!G) diff --git a/code/modules/power/port_gen.dm b/code/modules/power/port_gen.dm index cc4c65527c101..c0762c7cf19ac 100644 --- a/code/modules/power/port_gen.dm +++ b/code/modules/power/port_gen.dm @@ -30,7 +30,7 @@ /obj/machinery/power/port_gen/proc/handleInactive() return -/obj/machinery/power/port_gen/process() +/obj/machinery/power/port_gen/Process() if(active && HasFuel() && !IsBroken() && anchored && powernet) add_avail(power_gen * power_output) UseFuel() diff --git a/code/modules/power/sensors/powernet_sensor.dm b/code/modules/power/sensors/powernet_sensor.dm index d1f42df46ad76..dde967c5ce1f3 100644 --- a/code/modules/power/sensors/powernet_sensor.dm +++ b/code/modules/power/sensors/powernet_sensor.dm @@ -45,7 +45,7 @@ // Proc: process() // Parameters: None // Description: This has to be here because we need sensors to remain in Machines list. -/obj/machinery/power/sensor/process() +/obj/machinery/power/sensor/Process() return 1 // Proc: reading_to_text() diff --git a/code/modules/power/sensors/sensor_monitoring.dm b/code/modules/power/sensors/sensor_monitoring.dm index 61ab6eadc4269..c26b06b55b7f4 100644 --- a/code/modules/power/sensors/sensor_monitoring.dm +++ b/code/modules/power/sensors/sensor_monitoring.dm @@ -22,7 +22,7 @@ var/datum/nano_module/power_monitor/power_monitor // Checks the sensors for alerts. If change (alerts cleared or detected) occurs, calls for icon update. -/obj/machinery/computer/power_monitor/process() +/obj/machinery/computer/power_monitor/Process() var/alert = check_warnings() if(alert != alerting) alerting = !alerting diff --git a/code/modules/power/singularity/collector.dm b/code/modules/power/singularity/collector.dm index a9e41dde162be..4a70a2f1fcb2f 100644 --- a/code/modules/power/singularity/collector.dm +++ b/code/modules/power/singularity/collector.dm @@ -25,7 +25,7 @@ var/global/list/rad_collectors = list() rad_collectors -= src . = ..() -/obj/machinery/power/rad_collector/process() +/obj/machinery/power/rad_collector/Process() //so that we don't zero out the meter if the SM is processed first. last_power = last_power_new last_power_new = 0 diff --git a/code/modules/power/singularity/emitter.dm b/code/modules/power/singularity/emitter.dm index 6210a8325212c..598705bf74710 100644 --- a/code/modules/power/singularity/emitter.dm +++ b/code/modules/power/singularity/emitter.dm @@ -102,7 +102,7 @@ /obj/machinery/power/emitter/emp_act(var/severity) return 1 -/obj/machinery/power/emitter/process() +/obj/machinery/power/emitter/Process() if(stat & (BROKEN)) return if(src.state != 2 || (!powernet && active_power_usage)) diff --git a/code/modules/power/singularity/field_generator.dm b/code/modules/power/singularity/field_generator.dm index e2fab0cd5cfcc..fe18e227f6849 100644 --- a/code/modules/power/singularity/field_generator.dm +++ b/code/modules/power/singularity/field_generator.dm @@ -61,7 +61,7 @@ field_generator power level display connected_gens = list() return -/obj/machinery/field_generator/process() +/obj/machinery/field_generator/Process() if(Varedit_start == 1) if(active == 0) active = 1 @@ -332,7 +332,7 @@ field_generator power level display //I want to avoid using global variables. spawn(1) var/temp = 1 //stops spam - for(var/obj/singularity/O in GLOB.machines) + for(var/obj/singularity/O in SSmachines.machinery) if(O.last_warning && temp) if((world.time - O.last_warning) > 50) //to stop message-spam temp = 0 diff --git a/code/modules/power/singularity/generator.dm b/code/modules/power/singularity/generator.dm index 41b0e18c2c0f5..69593ad16c9a0 100644 --- a/code/modules/power/singularity/generator.dm +++ b/code/modules/power/singularity/generator.dm @@ -9,7 +9,7 @@ use_power = 0 var/energy = 0 -/obj/machinery/the_singularitygen/process() +/obj/machinery/the_singularitygen/Process() var/turf/T = get_turf(src) if(src.energy >= 200) new /obj/singularity/(T, 50) diff --git a/code/modules/power/singularity/particle_accelerator/particle_control.dm b/code/modules/power/singularity/particle_accelerator/particle_control.dm index 4fa615faef0e7..1d6c5d8051138 100644 --- a/code/modules/power/singularity/particle_accelerator/particle_control.dm +++ b/code/modules/power/singularity/particle_accelerator/particle_control.dm @@ -147,7 +147,7 @@ return -/obj/machinery/particle_accelerator/control_box/process() +/obj/machinery/particle_accelerator/control_box/Process() if(src.active) //a part is missing! if( length(connected_parts) < 6 ) diff --git a/code/modules/power/singularity/singularity.dm b/code/modules/power/singularity/singularity.dm index 52506b11a4dfe..9c4d47b813ebf 100644 --- a/code/modules/power/singularity/singularity.dm +++ b/code/modules/power/singularity/singularity.dm @@ -40,14 +40,14 @@ qdel(src) ..() - GLOB.processing_objects += src - for(var/obj/machinery/power/singularity_beacon/singubeacon in GLOB.machines) + START_PROCESSING(SSobj, src) + for(var/obj/machinery/power/singularity_beacon/singubeacon in SSmachines.machinery) if(singubeacon.active) target = singubeacon break /obj/singularity/Destroy() - GLOB.processing_objects -= src + STOP_PROCESSING(SSobj, src) . = ..() /obj/singularity/attack_hand(mob/user as mob) @@ -78,7 +78,7 @@ /obj/singularity/Bumped(atom/A) consume(A) -/obj/singularity/process() +/obj/singularity/Process() eat() dissipate() check_energy() diff --git a/code/modules/power/smes.dm b/code/modules/power/smes.dm index 430982789bc09..a899de471df72 100644 --- a/code/modules/power/smes.dm +++ b/code/modules/power/smes.dm @@ -141,7 +141,7 @@ /obj/machinery/power/smes/proc/remove_charge(var/amount) charge -= amount*CELLRATE -/obj/machinery/power/smes/process() +/obj/machinery/power/smes/Process() if(stat & BROKEN) return if(failure_timer) // Disabled by gridcheck. failure_timer-- diff --git a/code/modules/power/smes_construction.dm b/code/modules/power/smes_construction.dm index cead174491c94..8ece90031b0cc 100644 --- a/code/modules/power/smes_construction.dm +++ b/code/modules/power/smes_construction.dm @@ -107,7 +107,7 @@ // Parameters: None // Description: Uses parent process, but if grounding wire is cut causes sparks to fly around. // This also causes the SMES to quickly discharge, and has small chance of damaging output APCs. -/obj/machinery/power/smes/buildable/process() +/obj/machinery/power/smes/buildable/Process() if(!grounding && (Percentage() > 5)) var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread s.set_up(5, 1, src) diff --git a/code/modules/power/solar.dm b/code/modules/power/solar.dm index 73f4e1f208fb4..15ed5800edcee 100644 --- a/code/modules/power/solar.dm +++ b/code/modules/power/solar.dm @@ -115,7 +115,7 @@ var/list/solars_list = list() sunfrac = cos(p_angle) ** 2 //isn't the power recieved from the incoming light proportionnal to cos(p_angle) (Lambert's cosine law) rather than cos(p_angle)^2 ? -/obj/machinery/power/solar/process()//TODO: remove/add this from machines to save on processing as needed ~Carn PRIORITY +/obj/machinery/power/solar/Process()//TODO: remove/add this from machines to save on processing as needed ~Carn PRIORITY if(stat & BROKEN) return if(!GLOB.sun || !control) //if there's no sun or the panel is not linked to a solar control computer, no need to proceed @@ -168,7 +168,7 @@ var/list/solars_list = list() /obj/machinery/power/solar/fake/New(var/turf/loc, var/obj/item/solar_assembly/S) ..(loc, S, 0) -/obj/machinery/power/solar/fake/process() +/obj/machinery/power/solar/fake/Process() . = PROCESS_KILL return @@ -433,7 +433,7 @@ var/list/solars_list = list() src.attack_hand(user) return -/obj/machinery/power/solar_control/process() +/obj/machinery/power/solar_control/Process() lastgen = gen gen = 0 diff --git a/code/modules/power/terminal.dm b/code/modules/power/terminal.dm index c0eebf06d9697..f09526a5ab6b2 100644 --- a/code/modules/power/terminal.dm +++ b/code/modules/power/terminal.dm @@ -35,5 +35,5 @@ // Needed so terminals are not removed from machines list. // Powernet rebuilds need this to work properly. -/obj/machinery/power/terminal/process() +/obj/machinery/power/terminal/Process() return 1 diff --git a/code/modules/power/turbine.dm b/code/modules/power/turbine.dm index c4f2feaa19ced..28ff5f79241ed 100644 --- a/code/modules/power/turbine.dm +++ b/code/modules/power/turbine.dm @@ -59,7 +59,7 @@ #define COMPFRICTION 5e5 #define COMPSTARTERLOAD 2800 -/obj/machinery/compressor/process() +/obj/machinery/compressor/Process() if(!starter) return overlays.Cut() @@ -117,7 +117,7 @@ #define TURBGENQ 20000 #define TURBGENG 0.8 -/obj/machinery/power/turbine/process() +/obj/machinery/power/turbine/Process() if(!compressor.starter) return overlays.Cut() @@ -314,6 +314,6 @@ src.updateUsrDialog() return -/obj/machinery/computer/turbine_computer/process() +/obj/machinery/computer/turbine_computer/Process() src.updateDialog() return \ No newline at end of file diff --git a/code/modules/projectiles/guns/energy.dm b/code/modules/projectiles/guns/energy.dm index 83b5cd9ba4c82..40dde9c193361 100644 --- a/code/modules/projectiles/guns/energy.dm +++ b/code/modules/projectiles/guns/energy.dm @@ -37,15 +37,15 @@ else power_supply = new /obj/item/weapon/cell/device/variable(src, max_shots*charge_cost) if(self_recharge) - GLOB.processing_objects.Add(src) + START_PROCESSING(SSobj, src) update_icon() /obj/item/weapon/gun/energy/Destroy() if(self_recharge) - GLOB.processing_objects.Remove(src) + STOP_PROCESSING(SSobj, src) return ..() -/obj/item/weapon/gun/energy/process() +/obj/item/weapon/gun/energy/Process() . = PROCESS_KILL . = ..() if(self_recharge) @@ -75,7 +75,7 @@ if(!ispath(projectile_type)) return null if(!power_supply.checked_use(charge_cost)) return null if(self_recharge) - GLOB.processing_objects.Add(src) + START_PROCESSING(SSobj, src) return new projectile_type(src) /obj/item/weapon/gun/energy/proc/get_external_power_supply() @@ -120,11 +120,11 @@ icon_state = "[modifystate][ratio]" else icon_state = "[initial(icon_state)][ratio]" - + /obj/item/weapon/gun/energy/ammo_check() - + if(!power_supply || power_supply.charge < 1) //If we have no power supply or it does not have enough charge to fire it fails the check return 0 - else + else return 1 diff --git a/code/modules/projectiles/guns/energy/nuclear.dm b/code/modules/projectiles/guns/energy/nuclear.dm index bd0bf2f28954f..6e1bd66694f1f 100644 --- a/code/modules/projectiles/guns/energy/nuclear.dm +++ b/code/modules/projectiles/guns/energy/nuclear.dm @@ -57,7 +57,7 @@ var/fail_counter = 0 //override for failcheck behaviour -/obj/item/weapon/gun/energy/gun/nuclear/process() +/obj/item/weapon/gun/energy/gun/nuclear/Process() if(fail_counter > 0) radiation_repository.radiate(src, fail_counter--) diff --git a/code/modules/projectiles/guns/energy/temperature.dm b/code/modules/projectiles/guns/energy/temperature.dm index abc8c761bce58..0353ade87367f 100644 --- a/code/modules/projectiles/guns/energy/temperature.dm +++ b/code/modules/projectiles/guns/energy/temperature.dm @@ -17,11 +17,11 @@ /obj/item/weapon/gun/energy/temperature/Initialize() . = ..() - GLOB.processing_objects.Add(src) + START_PROCESSING(SSobj, src) /obj/item/weapon/gun/energy/temperature/Destroy() - GLOB.processing_objects.Remove(src) + STOP_PROCESSING(SSobj, src) . = ..() @@ -62,7 +62,7 @@ return -/obj/item/weapon/gun/energy/temperature/process() +/obj/item/weapon/gun/energy/temperature/Process() switch(temperature) if(0 to 100) charge_cost = 100 if(100 to 250) charge_cost = 50 diff --git a/code/modules/projectiles/guns/launcher/alien.dm b/code/modules/projectiles/guns/launcher/alien.dm index 16b9ba4ad7c81..87a9aad3c99fc 100644 --- a/code/modules/projectiles/guns/launcher/alien.dm +++ b/code/modules/projectiles/guns/launcher/alien.dm @@ -8,14 +8,14 @@ /obj/item/weapon/gun/launcher/alien/Initialize() . = ..() - GLOB.processing_objects.Add(src) + START_PROCESSING(SSobj, src) last_regen = world.time /obj/item/weapon/gun/launcher/alien/Destroy() - GLOB.processing_objects.Remove(src) + STOP_PROCESSING(SSobj, src) return ..() -/obj/item/weapon/gun/launcher/alien/process() +/obj/item/weapon/gun/launcher/alien/Process() if(ammo < max_ammo && world.time > last_regen + ammo_gen_time) ammo++ last_regen = world.time diff --git a/code/modules/projectiles/projectile.dm b/code/modules/projectiles/projectile.dm index 6d031a1fab40c..df87c18f0b617 100644 --- a/code/modules/projectiles/projectile.dm +++ b/code/modules/projectiles/projectile.dm @@ -153,7 +153,7 @@ spawn() setup_trajectory(curloc, targloc, x_offset, y_offset, angle_offset) //plot the initial trajectory - process() + Process() return 0 @@ -335,7 +335,7 @@ /obj/item/projectile/CanPass(atom/movable/mover, turf/target, height=0, air_group=0) return 1 -/obj/item/projectile/process() +/obj/item/projectile/Process() spawn while(src && src.loc) if(kill_count < initial(kill_count) - SUPPRESSION_GRACE_STEPS) do_suppression_aoe(loc) @@ -478,9 +478,9 @@ //plot the initial trajectory setup_trajectory(curloc, targloc) - return process(targloc) + return Process(targloc) -/obj/item/projectile/test/process(var/turf/targloc) +/obj/item/projectile/test/Process(var/turf/targloc) while(src) //Loop on through! if(result) return (result - 1) diff --git a/code/modules/projectiles/projectile/bullets.dm b/code/modules/projectiles/projectile/bullets.dm index e06b6a2dfe941..d526c0db06959 100644 --- a/code/modules/projectiles/projectile/bullets.dm +++ b/code/modules/projectiles/projectile/bullets.dm @@ -214,7 +214,7 @@ embed = 0 sharp = 0 -/obj/item/projectile/bullet/pistol/cap/process() +/obj/item/projectile/bullet/pistol/cap/Process() loc = null qdel(src) diff --git a/code/modules/projectiles/targeting/targeting_overlay.dm b/code/modules/projectiles/targeting/targeting_overlay.dm index e5927730ac526..0f3af1002569e 100644 --- a/code/modules/projectiles/targeting/targeting_overlay.dm +++ b/code/modules/projectiles/targeting/targeting_overlay.dm @@ -77,7 +77,7 @@ to_chat(owner, aim_message) if(aiming_at) to_chat(aiming_at, "You are [message].") -/obj/aiming_overlay/process() +/obj/aiming_overlay/Process() if(!owner) qdel(src) return @@ -172,7 +172,7 @@ obj/aiming_overlay/proc/update_aiming_deferred() forceMove(get_turf(target)) - GLOB.processing_objects |= src + START_PROCESSING(SSobj, src) aiming_at.aimed |= src toggle_active(1) @@ -226,7 +226,7 @@ obj/aiming_overlay/proc/update_aiming_deferred() aiming_with = null loc = null - GLOB.processing_objects -= src + STOP_PROCESSING(SSobj, src) /obj/aiming_overlay/proc/target_moved() update_aiming() diff --git a/code/modules/reagents/Chemistry-Holder.dm b/code/modules/reagents/Chemistry-Holder.dm index 2f3e2c7298034..278cfe4e76cfd 100644 --- a/code/modules/reagents/Chemistry-Holder.dm +++ b/code/modules/reagents/Chemistry-Holder.dm @@ -96,7 +96,7 @@ eligible_reactions |= chemical_reactions_list[R.type] for(var/datum/chemical_reaction/C in eligible_reactions) - if(C.can_happen(src) && C.process(src)) + if(C.can_happen(src) && C.Process(src)) effect_reactions |= C reaction_occured = 1 diff --git a/code/modules/reagents/Chemistry-Recipes.dm b/code/modules/reagents/Chemistry-Recipes.dm index 04754df0f4c5b..fef5916cf4472 100644 --- a/code/modules/reagents/Chemistry-Recipes.dm +++ b/code/modules/reagents/Chemistry-Recipes.dm @@ -96,7 +96,7 @@ return progress -/datum/chemical_reaction/proc/process(var/datum/reagents/holder) +/datum/chemical_reaction/Process(var/datum/reagents/holder) //determine how far the reaction can proceed var/list/reaction_limits = list() for(var/reactant in required_reagents) diff --git a/code/modules/reagents/reagent_containers/borghydro.dm b/code/modules/reagents/reagent_containers/borghydro.dm index 8515e80c3d69d..a0038cb5adf27 100644 --- a/code/modules/reagents/reagent_containers/borghydro.dm +++ b/code/modules/reagents/reagent_containers/borghydro.dm @@ -31,13 +31,13 @@ var/datum/reagent/R = GLOB.chemical_reagents_list[T] reagent_names += R.name - GLOB.processing_objects.Add(src) + START_PROCESSING(SSobj, src) /obj/item/weapon/reagent_containers/borghypo/Destroy() - GLOB.processing_objects.Remove(src) + STOP_PROCESSING(SSobj, src) . = ..() -/obj/item/weapon/reagent_containers/borghypo/process() //Every [recharge_time] seconds, recharge some reagents for the cyborg+ +/obj/item/weapon/reagent_containers/borghypo/Process() //Every [recharge_time] seconds, recharge some reagents for the cyborg+ if(++charge_tick < recharge_time) return 0 charge_tick = 0 diff --git a/code/modules/recycling/conveyor2.dm b/code/modules/recycling/conveyor2.dm index 0802efe401fc6..99b632dc4b4ac 100644 --- a/code/modules/recycling/conveyor2.dm +++ b/code/modules/recycling/conveyor2.dm @@ -61,7 +61,7 @@ // machine process // move items to the target location -/obj/machinery/conveyor/process() +/obj/machinery/conveyor/Process() if(stat & (BROKEN | NOPOWER)) return if(!operating) @@ -204,7 +204,7 @@ // timed process // if the switch changed, update the linked conveyors -/obj/machinery/conveyor_switch/process() +/obj/machinery/conveyor_switch/Process() if(!operated) return operated = 0 diff --git a/code/modules/recycling/disposal.dm b/code/modules/recycling/disposal.dm index 12937327887d4..fa45d998cedfa 100644 --- a/code/modules/recycling/disposal.dm +++ b/code/modules/recycling/disposal.dm @@ -360,7 +360,7 @@ // timed process // charge the gas reservoir and perform flush if ready -/obj/machinery/disposal/process() +/obj/machinery/disposal/Process() if(!air_contents || (stat & BROKEN)) // nothing can happen if broken update_use_power(0) return diff --git a/code/modules/research/circuitprinter.dm b/code/modules/research/circuitprinter.dm index 467f1d2e6733b..982fcbb352973 100644 --- a/code/modules/research/circuitprinter.dm +++ b/code/modules/research/circuitprinter.dm @@ -31,7 +31,7 @@ using metal and glass, it uses glass and reagents (usually sulphuric acid). component_parts += new /obj/item/weapon/reagent_containers/glass/beaker(src) RefreshParts() -/obj/machinery/r_n_d/circuit_imprinter/process() +/obj/machinery/r_n_d/circuit_imprinter/Process() ..() if(stat) update_icon() diff --git a/code/modules/research/protolathe.dm b/code/modules/research/protolathe.dm index f4853489fc6f9..c51cb4155f3ce 100644 --- a/code/modules/research/protolathe.dm +++ b/code/modules/research/protolathe.dm @@ -28,7 +28,7 @@ component_parts += new /obj/item/weapon/reagent_containers/glass/beaker(src) RefreshParts() -/obj/machinery/r_n_d/protolathe/process() +/obj/machinery/r_n_d/protolathe/Process() ..() if(stat) update_icon() diff --git a/code/modules/research/rdconsole.dm b/code/modules/research/rdconsole.dm index 139d682694df3..78e645466d7d7 100644 --- a/code/modules/research/rdconsole.dm +++ b/code/modules/research/rdconsole.dm @@ -92,7 +92,7 @@ won't update every console in existence) but it's more of a hassle to do. Also, files.AddDesign2Known(new /datum/design/prefab(files,create_prefab_from_assembly(assembly))) /obj/machinery/computer/rdconsole/proc/griefProtection() //Have it automatically push research to the centcomm server so wild griffins can't fuck up R&D's work - for(var/obj/machinery/r_n_d/server/centcom/C in GLOB.machines) + for(var/obj/machinery/r_n_d/server/centcom/C in SSmachines.machinery) for(var/datum/tech/T in files.known_tech) C.files.AddTech2Known(T) for(var/datum/design/D in files.known_designs) @@ -103,7 +103,7 @@ won't update every console in existence) but it's more of a hassle to do. Also, ..() files = new /datum/research(src) //Setup the research data holder. if(!id) - for(var/obj/machinery/r_n_d/server/centcom/S in GLOB.machines) + for(var/obj/machinery/r_n_d/server/centcom/S in SSmachines.machinery) S.update_connections() break @@ -276,7 +276,7 @@ won't update every console in existence) but it's more of a hassle to do. Also, griefProtection() //Putting this here because I dont trust the sync process spawn(30) if(src) - for(var/obj/machinery/r_n_d/server/S in GLOB.machines) + for(var/obj/machinery/r_n_d/server/S in SSmachines.machinery) var/server_processed = 0 if((id in S.id_with_upload) || istype(S, /obj/machinery/r_n_d/server/centcom)) for(var/datum/tech/T in files.known_tech) diff --git a/code/modules/research/server.dm b/code/modules/research/server.dm index e6f7c2631c9ce..b7c5705f706f5 100644 --- a/code/modules/research/server.dm +++ b/code/modules/research/server.dm @@ -49,7 +49,7 @@ for(var/N in temp_list) id_with_download += text2num(N) -/obj/machinery/r_n_d/server/process() +/obj/machinery/r_n_d/server/Process() var/datum/gas_mixture/environment = loc.return_air() switch(environment.temperature) if(0 to T0C) @@ -81,7 +81,7 @@ //Backup files to centcomm to help admins recover data after greifer attacks /obj/machinery/r_n_d/server/proc/griefProtection() - for(var/obj/machinery/r_n_d/server/centcom/C in GLOB.machines) + for(var/obj/machinery/r_n_d/server/centcom/C in SSmachines.machinery) for(var/datum/tech/T in files.known_tech) C.files.AddTech2Known(T) for(var/datum/design/D in files.known_designs) @@ -126,7 +126,7 @@ /obj/machinery/r_n_d/server/centcom/proc/update_connections() var/list/no_id_servers = list() var/list/server_ids = list() - for(var/obj/machinery/r_n_d/server/S in GLOB.machines) + for(var/obj/machinery/r_n_d/server/S in SSmachines.machinery) switch(S.server_id) if(-1) continue @@ -145,7 +145,7 @@ server_ids += num no_id_servers -= S -/obj/machinery/r_n_d/server/centcom/process() +/obj/machinery/r_n_d/server/centcom/Process() return PROCESS_KILL //don't need process() /obj/machinery/computer/rdservercontrol @@ -177,20 +177,20 @@ temp_server = null consoles = list() servers = list() - for(var/obj/machinery/r_n_d/server/S in GLOB.machines) + for(var/obj/machinery/r_n_d/server/S in SSmachines.machinery) if(S.server_id == text2num(href_list["access"]) || S.server_id == text2num(href_list["data"]) || S.server_id == text2num(href_list["transfer"])) temp_server = S break if(href_list["access"]) screen = 1 - for(var/obj/machinery/computer/rdconsole/C in GLOB.machines) + for(var/obj/machinery/computer/rdconsole/C in SSmachines.machinery) if(C.sync) consoles += C else if(href_list["data"]) screen = 2 else if(href_list["transfer"]) screen = 3 - for(var/obj/machinery/r_n_d/server/S in GLOB.machines) + for(var/obj/machinery/r_n_d/server/S in SSmachines.machinery) if(S == src) continue servers += S @@ -240,7 +240,7 @@ if(0) //Main Menu dat += "Connected Servers:

" - for(var/obj/machinery/r_n_d/server/S in GLOB.machines) + for(var/obj/machinery/r_n_d/server/S in SSmachines.machinery) if(istype(S, /obj/machinery/r_n_d/server/centcom) && !badmin) continue dat += "[S.name] || " diff --git a/code/modules/security levels/security levels.dm b/code/modules/security levels/security levels.dm index e8db0494b1ab4..614b0e3eba963 100644 --- a/code/modules/security levels/security levels.dm +++ b/code/modules/security levels/security levels.dm @@ -46,7 +46,7 @@ post_status("alert", "deltaalert") var/newlevel = get_security_level() - for(var/obj/machinery/firealarm/FA in GLOB.machines) + for(var/obj/machinery/firealarm/FA in SSmachines.machinery) if(FA.z in GLOB.using_map.contact_levels) FA.set_security_level(newlevel) diff --git a/code/modules/shield_generators/floor_diffuser.dm b/code/modules/shield_generators/floor_diffuser.dm index a47315a376a6a..163525088f58b 100644 --- a/code/modules/shield_generators/floor_diffuser.dm +++ b/code/modules/shield_generators/floor_diffuser.dm @@ -13,7 +13,7 @@ var/alarm = 0 var/enabled = 1 -/obj/machinery/shield_diffuser/process() +/obj/machinery/shield_diffuser/Process() if(alarm) alarm-- if(!alarm) diff --git a/code/modules/shield_generators/handheld_diffuser.dm b/code/modules/shield_generators/handheld_diffuser.dm index b9494fbd21000..16563aec16fa0 100644 --- a/code/modules/shield_generators/handheld_diffuser.dm +++ b/code/modules/shield_generators/handheld_diffuser.dm @@ -21,10 +21,10 @@ cell = null QDEL_NULL(cell) if(enabled) - GLOB.processing_objects.Remove(src) + STOP_PROCESSING(SSobj, src) . = ..() -/obj/item/weapon/shield_diffuser/process() +/obj/item/weapon/shield_diffuser/Process() if(!enabled) return @@ -39,9 +39,9 @@ enabled = !enabled update_icon() if(enabled) - GLOB.processing_objects.Add(src) + START_PROCESSING(SSobj, src) else - GLOB.processing_objects.Remove(src) + STOP_PROCESSING(SSobj, src) to_chat(usr, "You turn \the [src] [enabled ? "on" : "off"].") /obj/item/weapon/shield_diffuser/examine() diff --git a/code/modules/shield_generators/shield_generator.dm b/code/modules/shield_generators/shield_generator.dm index c70c7f083a744..5764d686139a8 100644 --- a/code/modules/shield_generators/shield_generator.dm +++ b/code/modules/shield_generators/shield_generator.dm @@ -125,7 +125,7 @@ upkeep_multiplier = new_upkeep -/obj/machinery/power/shield_generator/process() +/obj/machinery/power/shield_generator/Process() upkeep_power_usage = 0 power_usage = 0 diff --git a/code/modules/shieldgen/emergency_shield.dm b/code/modules/shieldgen/emergency_shield.dm index c914270c5ad87..040ceb395a8c1 100644 --- a/code/modules/shieldgen/emergency_shield.dm +++ b/code/modules/shieldgen/emergency_shield.dm @@ -17,7 +17,7 @@ desc = "A weak forcefield which seems to be projected by the emergency atmosphere containment field." health = max_health/2 // Half health, it's not suposed to resist much. -/obj/machinery/shield/malfai/process() +/obj/machinery/shield/malfai/Process() health -= 0.5 // Slowly lose integrity over time check_failure() @@ -181,7 +181,7 @@ else create_shields() -/obj/machinery/shieldgen/process() +/obj/machinery/shieldgen/Process() if (!active || (stat & NOPOWER)) return diff --git a/code/modules/shieldgen/shieldwallgen.dm b/code/modules/shieldgen/shieldwallgen.dm index 1c144cdbac59f..fde664cb37ba1 100644 --- a/code/modules/shieldgen/shieldwallgen.dm +++ b/code/modules/shieldgen/shieldwallgen.dm @@ -118,7 +118,7 @@ power = 1 // IVE GOT THE POWER! return 1 -/obj/machinery/shieldwallgen/process() +/obj/machinery/shieldwallgen/Process() power = 0 if(!(stat & BROKEN)) power() @@ -303,7 +303,7 @@ user.do_attack_animation(src) playsound(loc, 'sound/weapons/smash.ogg', 75, 1) -/obj/machinery/shieldwall/process() +/obj/machinery/shieldwall/Process() if(needs_power) if(isnull(gen_primary)||isnull(gen_secondary)) qdel(src) diff --git a/code/modules/shuttles/escape_pods.dm b/code/modules/shuttles/escape_pods.dm index 4e38b9aa402e7..6cb124a83041a 100644 --- a/code/modules/shuttles/escape_pods.dm +++ b/code/modules/shuttles/escape_pods.dm @@ -142,7 +142,7 @@ var/list/escape_pods_by_name = list() return ..(command) -/datum/computer/file/embedded_program/docking/simple/escape_pod/process() +/datum/computer/file/embedded_program/docking/simple/escape_pod/Process() ..() if (eject_time && world.time >= eject_time && !closing) close_door() diff --git a/code/modules/shuttles/shuttle_autodock.dm b/code/modules/shuttles/shuttle_autodock.dm index 04ef46b9fcdb1..9bb4abe2a0591 100644 --- a/code/modules/shuttles/shuttle_autodock.dm +++ b/code/modules/shuttles/shuttle_autodock.dm @@ -75,7 +75,7 @@ Please ensure that long_jump() and short_jump() are only called from here. This applies to subtypes as well. Doing so will ensure that multiple jumps cannot be initiated in parallel. */ -/datum/shuttle/autodock/proc/process() +/datum/shuttle/autodock/Process() switch(process_state) if (WAIT_LAUNCH) if(check_undocked()) diff --git a/code/modules/spells/spell_code.dm b/code/modules/spells/spell_code.dm index 80647a988874d..cfcf9d15a4542 100644 --- a/code/modules/spells/spell_code.dm +++ b/code/modules/spells/spell_code.dm @@ -75,7 +75,7 @@ var/list/spells = typesof(/spell) //needed for the badmin verb for now //still_recharging_msg = "[name] is still recharging." charge_counter = charge_max -/spell/proc/process() +/spell/Process() if(processing) return processing = 1 @@ -275,7 +275,7 @@ var/list/spells = typesof(/spell) //needed for the badmin verb for now switch(charge_type) if(Sp_RECHARGE) charge_counter = 0 //doesn't start recharging until the targets selecting ends - src.process() + src.Process() return 1 if(Sp_CHARGES) charge_counter-- //returns the charge if the targets selecting fails diff --git a/code/modules/spells/spellbook.dm b/code/modules/spells/spellbook.dm index c866de3052ce5..08126e51e2dcd 100644 --- a/code/modules/spells/spellbook.dm +++ b/code/modules/spells/spellbook.dm @@ -238,22 +238,22 @@ var/list/artefact_feedback = list(/obj/structure/closet/wizard/armor = "HS", if(investing_time) return "You can only invest one spell slot at a time." uses-- - GLOB.processing_objects += src + START_PROCESSING(SSobj, src) investing_time = world.time + (15 MINUTES) return "You invest a spellslot and will recieve two in return in 15 minutes." -/obj/item/weapon/spellbook/process() +/obj/item/weapon/spellbook/Process() if(investing_time && investing_time <= world.time) src.visible_message("\The [src] chims.") uses += 2 if(uses > spellbook.max_uses) spellbook.max_uses = uses investing_time = 0 - GLOB.processing_objects -= src + STOP_PROCESSING(SSobj, src) return 1 /obj/item/weapon/spellbook/Destroy() - GLOB.processing_objects -= src + STOP_PROCESSING(SSobj, src) ..() /obj/item/weapon/spellbook/proc/send_feedback(var/path) diff --git a/code/modules/supermatter/supermatter.dm b/code/modules/supermatter/supermatter.dm index 55e235faf54f0..266ae8ad31c73 100644 --- a/code/modules/supermatter/supermatter.dm +++ b/code/modules/supermatter/supermatter.dm @@ -209,7 +209,7 @@ to_chat(mob, "An invisible force slams you against the ground!") // Effect 2: Z-level wide electrical pulse - for(var/obj/machinery/power/apc/A in GLOB.machines) + for(var/obj/machinery/power/apc/A in SSmachines.machinery) if(!(A.z in affected_z)) continue @@ -223,7 +223,7 @@ else A.energy_fail(round(DETONATION_SHUTDOWN_APC * random_change)) - for(var/obj/machinery/power/smes/buildable/S in GLOB.machines) + for(var/obj/machinery/power/smes/buildable/S in SSmachines.machinery) if(!(S.z in affected_z)) continue // Causes SMESes to shut down for a bit @@ -232,7 +232,7 @@ // Effect 3: Break solar arrays - for(var/obj/machinery/power/solar/S in GLOB.machines) + for(var/obj/machinery/power/solar/S in SSmachines.machinery) if(!(S.z in affected_z)) continue if(prob(DETONATION_SOLAR_BREAK_CHANCE)) @@ -289,7 +289,7 @@ public_alert = 0 -/obj/machinery/power/supermatter/process() +/obj/machinery/power/supermatter/Process() var/turf/L = loc diff --git a/code/modules/tgui/process.dm b/code/modules/tgui/process.dm index e1e04f6e2630c..1eb0fdfc095c3 100644 --- a/code/modules/tgui/process.dm +++ b/code/modules/tgui/process.dm @@ -73,7 +73,7 @@ for(var/ui_key in tg_open_uis[src_object_key]) for(var/datum/tgui/ui in tg_open_uis[src_object_key][ui_key]) if(ui && ui.src_object && ui.user && ui.src_object.ui_host()) // Check the UI is valid. - ui.process(force = 1) // Update the UI. + ui.Process(force = 1) // Update the UI. update_count++ // Count each UI we update. return update_count @@ -117,7 +117,7 @@ var/update_count = 0 for(var/datum/tgui/ui in user.tg_open_uis) if((isnull(src_object) || !isnull(src_object) && ui.src_object == src_object) && (isnull(ui_key) || !isnull(ui_key) && ui.ui_key == ui_key)) - ui.process(force = 1) // Update the UI. + ui.Process(force = 1) // Update the UI. update_count++ // Count each UI we upadte. return update_count diff --git a/code/modules/tgui/tgui.dm b/code/modules/tgui/tgui.dm index 4bdce63859a37..9e4481add2469 100644 --- a/code/modules/tgui/tgui.dm +++ b/code/modules/tgui/tgui.dm @@ -300,7 +300,7 @@ * * optional force bool If the UI should be forced to update. **/ -/datum/tgui/proc/process(force = 0) +/datum/tgui/Process(force = 0) var/datum/host = src_object.ui_host() if(!src_object || !host || !user) // If the object or user died (or something else), abort. close() diff --git a/code/modules/virus2/analyser.dm b/code/modules/virus2/analyser.dm index 76bee77275d4d..79764d4b316ef 100644 --- a/code/modules/virus2/analyser.dm +++ b/code/modules/virus2/analyser.dm @@ -23,7 +23,7 @@ user.visible_message("[user] adds \a [O] to \the [src]!", "You add \a [O] to \the [src]!") -/obj/machinery/disease2/diseaseanalyser/process() +/obj/machinery/disease2/diseaseanalyser/Process() if(stat & (NOPOWER|BROKEN)) return diff --git a/code/modules/virus2/centrifuge.dm b/code/modules/virus2/centrifuge.dm index 3392ff3b7fbf8..5dc8e4a8d639f 100644 --- a/code/modules/virus2/centrifuge.dm +++ b/code/modules/virus2/centrifuge.dm @@ -77,7 +77,7 @@ ui.set_initial_data(data) ui.open() -/obj/machinery/computer/centrifuge/process() +/obj/machinery/computer/centrifuge/Process() ..() if (stat & (NOPOWER|BROKEN)) return diff --git a/code/modules/virus2/curer.dm b/code/modules/virus2/curer.dm index c3cbdbdea4101..19cb45d27e8ad 100644 --- a/code/modules/virus2/curer.dm +++ b/code/modules/virus2/curer.dm @@ -65,7 +65,7 @@ onclose(user, "computer") return -/obj/machinery/computer/curer/process() +/obj/machinery/computer/curer/Process() ..() if(stat & (NOPOWER|BROKEN)) diff --git a/code/modules/virus2/disease2.dm b/code/modules/virus2/disease2.dm index 2ff59aaa1e36b..93a3e1121ca7d 100644 --- a/code/modules/virus2/disease2.dm +++ b/code/modules/virus2/disease2.dm @@ -53,7 +53,7 @@ res |= picked.primitive_form return res -/datum/disease2/disease/proc/process(var/mob/living/carbon/human/mob) +/datum/disease2/disease/Process(var/mob/living/carbon/human/mob) if(dead) cure(mob) return diff --git a/code/modules/virus2/diseasesplicer.dm b/code/modules/virus2/diseasesplicer.dm index 59d3f501d4f0d..3da5afe78d344 100644 --- a/code/modules/virus2/diseasesplicer.dm +++ b/code/modules/virus2/diseasesplicer.dm @@ -86,7 +86,7 @@ ui.set_initial_data(data) ui.open() -/obj/machinery/computer/diseasesplicer/process() +/obj/machinery/computer/diseasesplicer/Process() if(stat & (NOPOWER|BROKEN)) return diff --git a/code/modules/virus2/dishincubator.dm b/code/modules/virus2/dishincubator.dm index f835ee30f08bf..b0521c1b188ca 100644 --- a/code/modules/virus2/dishincubator.dm +++ b/code/modules/virus2/dishincubator.dm @@ -88,7 +88,7 @@ ui.set_initial_data(data) ui.open() -/obj/machinery/disease2/incubator/process() +/obj/machinery/disease2/incubator/Process() if(dish && on && dish.virus2) use_power(50,EQUIP) if(!powered(EQUIP)) diff --git a/code/modules/virus2/isolator.dm b/code/modules/virus2/isolator.dm index b31d96da2c421..7e1a8aa18c72c 100644 --- a/code/modules/virus2/isolator.dm +++ b/code/modules/virus2/isolator.dm @@ -106,7 +106,7 @@ ui.set_initial_data(data) ui.open() -/obj/machinery/disease2/isolator/process() +/obj/machinery/disease2/isolator/Process() if (isolating > 0) isolating -= 1 if (isolating == 0) diff --git a/code/modules/xenoarcheaology/artifacts/artifact.dm b/code/modules/xenoarcheaology/artifacts/artifact.dm index e26e495cc9871..f752976617349 100644 --- a/code/modules/xenoarcheaology/artifacts/artifact.dm +++ b/code/modules/xenoarcheaology/artifacts/artifact.dm @@ -61,9 +61,9 @@ return if(my_effect) - my_effect.process() + my_effect.Process() if(secondary_effect) - secondary_effect.process() + secondary_effect.Process() if(pulledby) Bumped(pulledby) diff --git a/code/modules/xenoarcheaology/artifacts/autocloner.dm b/code/modules/xenoarcheaology/artifacts/autocloner.dm index b77337437e271..35ab7706cf620 100644 --- a/code/modules/xenoarcheaology/artifacts/autocloner.dm +++ b/code/modules/xenoarcheaology/artifacts/autocloner.dm @@ -40,7 +40,7 @@ /mob/living/simple_animal/hostile/retaliate/goat) //todo: how the hell is the asteroid permanently powered? -/obj/machinery/auto_cloner/process() +/obj/machinery/auto_cloner/Process() if(powered(power_channel)) if(!previous_power_state) previous_power_state = 1 diff --git a/code/modules/xenoarcheaology/artifacts/replicator.dm b/code/modules/xenoarcheaology/artifacts/replicator.dm index b7f83f0a56372..d30a7696b03f2 100644 --- a/code/modules/xenoarcheaology/artifacts/replicator.dm +++ b/code/modules/xenoarcheaology/artifacts/replicator.dm @@ -82,7 +82,7 @@ [pick("front","side","top","bottom","rear","inside")] of [src]. A [pick("slot","funnel","chute","tube")] opens up in the \ [pick("front","side","top","bottom","rear","inside")]." -/obj/machinery/replicator/process() +/obj/machinery/replicator/Process() if(spawning_types.len && powered()) spawn_progress_time += world.time - last_process_time if(spawn_progress_time > max_spawn_time) diff --git a/code/modules/xenoarcheaology/effect.dm b/code/modules/xenoarcheaology/effect.dm index 1e3c73c892a04..661764b09df2e 100644 --- a/code/modules/xenoarcheaology/effect.dm +++ b/code/modules/xenoarcheaology/effect.dm @@ -60,7 +60,7 @@ /datum/artifact_effect/proc/DoEffectPulse(var/atom/holder) /datum/artifact_effect/proc/UpdateMove() -/datum/artifact_effect/proc/process() +/datum/artifact_effect/Process() if(chargelevel < chargelevelmax) chargelevel++ diff --git a/code/modules/xenoarcheaology/effects/forcefield.dm b/code/modules/xenoarcheaology/effects/forcefield.dm index c25cbc6080f0e..3393ae6928d41 100644 --- a/code/modules/xenoarcheaology/effects/forcefield.dm +++ b/code/modules/xenoarcheaology/effects/forcefield.dm @@ -34,7 +34,7 @@ UpdateMove() return 1 -/datum/artifact_effect/forcefield/process() +/datum/artifact_effect/forcefield/Process() ..() for(var/obj/effect/energy_field/E in created_field) if(E.strength < 1) diff --git a/code/modules/xenoarcheaology/finds/special.dm b/code/modules/xenoarcheaology/finds/special.dm index 08c75fc16bebf..3d77958ee5839 100644 --- a/code/modules/xenoarcheaology/finds/special.dm +++ b/code/modules/xenoarcheaology/finds/special.dm @@ -61,14 +61,13 @@ var/wight_check_index = 1 var/list/shadow_wights = list() -/obj/item/weapon/vampiric/Iniitalize() +/obj/item/weapon/vampiric/Initialize() . = ..() GLOB.listening_objects += src START_PROCESSING(SSobj, src) /obj/item/weapon/vampiric/Destroy() - GLOB.processing_objects.Remove(src) GLOB.listening_objects -= src STOP_PROCESSING(SSobj, src) return ..() @@ -221,7 +220,7 @@ M.sleeping = max(M.sleeping,rand(5,10)) src.loc = null else - GLOB.processing_objects.Remove(src) + STOP_PROCESSING(SSobj, src) /obj/effect/shadow_wight/Bump(var/atom/obstacle) to_chat(obstacle, "You feel a chill run down your spine!") diff --git a/code/modules/xenoarcheaology/finds/talking.dm b/code/modules/xenoarcheaology/finds/talking.dm index c149b7c827ab3..cfa43559e499e 100644 --- a/code/modules/xenoarcheaology/finds/talking.dm +++ b/code/modules/xenoarcheaology/finds/talking.dm @@ -13,11 +13,11 @@ /datum/talking_atom/proc/init() if(holder_atom) - GLOB.processing_objects.Add(src) + START_PROCESSING(SSobj, src) -/datum/talking_atom/proc/process() +/datum/talking_atom/Process() if(!holder_atom) - GLOB.processing_objects.Remove(src) + STOP_PROCESSING(SSobj, src) else if(heard_words.len >= 1 && world.time > last_talk_time + talk_interval && prob(talk_chance)) SaySomething() @@ -110,7 +110,7 @@ var/list/listening = viewers(holder_atom) //spawns ghost chat - /*for(var/mob/M in GLOB.mob_list) + /*for(var/mob/M in SSmobs.mob_list) if (!M.client) continue //skip monkeys and leavers if (istype(M, /mob/new_player)) diff --git a/code/modules/xenoarcheaology/tools/ano_device_battery.dm b/code/modules/xenoarcheaology/tools/ano_device_battery.dm index 10df125eed92c..861bd51e04844 100644 --- a/code/modules/xenoarcheaology/tools/ano_device_battery.dm +++ b/code/modules/xenoarcheaology/tools/ano_device_battery.dm @@ -126,7 +126,7 @@ last_activation = world.time //process the effect - inserted_battery.battery_effect.process() + inserted_battery.battery_effect.Process() //work out if we need to shutdown if(inserted_battery.stored_charge <= 0) diff --git a/code/modules/xenoarcheaology/tools/artifact_analyser.dm b/code/modules/xenoarcheaology/tools/artifact_analyser.dm index 03d9c0703d127..801260f3309b7 100644 --- a/code/modules/xenoarcheaology/tools/artifact_analyser.dm +++ b/code/modules/xenoarcheaology/tools/artifact_analyser.dm @@ -54,7 +54,7 @@ user.set_machine(src) onclose(user, "artanalyser") -/obj/machinery/artifact_analyser/process() +/obj/machinery/artifact_analyser/Process() if(scan_in_progress && world.time > scan_completion_time) scan_in_progress = 0 updateDialog() diff --git a/code/modules/xenoarcheaology/tools/artifact_harvester.dm b/code/modules/xenoarcheaology/tools/artifact_harvester.dm index cae9481b8127e..752a6a3b84312 100644 --- a/code/modules/xenoarcheaology/tools/artifact_harvester.dm +++ b/code/modules/xenoarcheaology/tools/artifact_harvester.dm @@ -69,7 +69,7 @@ user << browse(dat, "window=artharvester;size=450x500") onclose(user, "artharvester") -/obj/machinery/artifact_harvester/process() +/obj/machinery/artifact_harvester/Process() if(stat & (NOPOWER|BROKEN)) return @@ -94,7 +94,7 @@ //do the effect if(inserted_battery.battery_effect) - inserted_battery.battery_effect.process() + inserted_battery.battery_effect.Process() //if the effect works by touch, activate it on anyone viewing the console if(inserted_battery.battery_effect.effect == EFFECT_TOUCH) diff --git a/code/modules/xenoarcheaology/tools/geosample_scanner.dm b/code/modules/xenoarcheaology/tools/geosample_scanner.dm index bd766ee02c03d..bcd33d9887b22 100644 --- a/code/modules/xenoarcheaology/tools/geosample_scanner.dm +++ b/code/modules/xenoarcheaology/tools/geosample_scanner.dm @@ -162,7 +162,7 @@ // auto update every Master Controller tick ui.set_auto_update(1) -/obj/machinery/radiocarbon_spectrometer/process() +/obj/machinery/radiocarbon_spectrometer/Process() if(scanning) if(!scanned_item || scanned_item.loc != src) scanned_item = null diff --git a/code/modules/xenoarcheaology/tools/suspension_generator.dm b/code/modules/xenoarcheaology/tools/suspension_generator.dm index aab6b2ea6b078..ea2d2a9a63bc1 100644 --- a/code/modules/xenoarcheaology/tools/suspension_generator.dm +++ b/code/modules/xenoarcheaology/tools/suspension_generator.dm @@ -15,7 +15,7 @@ ..() src.cell = new /obj/item/weapon/cell/high(src) -/obj/machinery/suspension_gen/process() +/obj/machinery/suspension_gen/Process() set background = 1 if(suspension_field) cell.use(power_use * CELLRATE) diff --git a/code/procs/hud.dm b/code/procs/hud.dm index ab89194ddf279..0e34e3a781e0b 100644 --- a/code/procs/hud.dm +++ b/code/procs/hud.dm @@ -80,7 +80,7 @@ mob/proc/in_view(var/turf/T) /mob/observer/eye/in_view(var/turf/T) var/list/viewed = new - for(var/mob/living/carbon/human/H in GLOB.mob_list) + for(var/mob/living/carbon/human/H in SSmobs.mob_list) if(get_dist(H, T) <= 7) viewed += H return viewed diff --git a/code/unit_tests/map_tests.dm b/code/unit_tests/map_tests.dm index 79190784a73d7..e5bf450bdbe0c 100644 --- a/code/unit_tests/map_tests.dm +++ b/code/unit_tests/map_tests.dm @@ -330,12 +330,12 @@ datum/unit_test/ladder_check/start_test() /datum/unit_test/cryopod_comp_check/start_test() var/pass = TRUE - for(var/obj/machinery/cryopod/C in GLOB.machines) + for(var/obj/machinery/cryopod/C in SSmachines.machinery) if(!C.control_computer) log_bad("[get_area(C)] lacks a cryopod control computer while holding a cryopod.") pass = FALSE - for(var/obj/machinery/computer/cryopod/C in GLOB.machines) + for(var/obj/machinery/computer/cryopod/C in SSmachines.machinery) if(!(locate(/obj/machinery/cryopod) in get_area(C))) log_bad("[get_area(C)] lacks a cryopod while holding a control computer.") pass = FALSE @@ -469,7 +469,7 @@ datum/unit_test/ladder_check/start_test() /datum/unit_test/simple_pipes_shall_not_face_north_or_west/start_test() var/failures = 0 - for(var/obj/machinery/atmospherics/pipe/simple/pipe in GLOB.machines) + for(var/obj/machinery/atmospherics/pipe/simple/pipe in SSmachines.machinery) if(!istype(pipe, /obj/machinery/atmospherics/pipe/simple/hidden) && !istype(pipe, /obj/machinery/atmospherics/pipe/simple/visible)) continue if(pipe.dir == NORTH || pipe.dir == WEST) diff --git a/maps/_gamemodes/firefight/overmind.dm b/maps/_gamemodes/firefight/overmind.dm index 471caa370ed12..a14c2d962c53d 100644 --- a/maps/_gamemodes/firefight/overmind.dm +++ b/maps/_gamemodes/firefight/overmind.dm @@ -11,7 +11,7 @@ /datum/npc_overmind/firefight/New() . = ..() - GLOB.processing_objects.Add(src) +START_PROCESSING(SSobj, src) /datum/npc_overmind/firefight/create_taskpoint_assign() //intentionally left blank diff --git a/maps/_gamemodes/firefight/process.dm b/maps/_gamemodes/firefight/process.dm index 8f1e4cb9c79c8..868fca53b0323 100644 --- a/maps/_gamemodes/firefight/process.dm +++ b/maps/_gamemodes/firefight/process.dm @@ -1,5 +1,5 @@ -/datum/game_mode/firefight/process() +/datum/game_mode/firefight/Process() //latest_tick_time = world.time if(is_spawning) diff --git a/maps/_gamemodes/invasion/gamemode.dm b/maps/_gamemodes/invasion/gamemode.dm index 26e32dbf8fa20..3ada8ae3a454e 100644 --- a/maps/_gamemodes/invasion/gamemode.dm +++ b/maps/_gamemodes/invasion/gamemode.dm @@ -177,7 +177,7 @@ if(objective.find_target()) F.objectives_without_targets -= objective -/datum/game_mode/outer_colonies/process() +/datum/game_mode/outer_colonies/Process() . = ..() if(scan_percent < 100 && scanner_destructions_left && scanners_active && world.time >= cov_scan_next_tick) if(allow_scan) diff --git a/maps/_gamemodes/packwar/mode_packwar_process.dm b/maps/_gamemodes/packwar/mode_packwar_process.dm index 89435d853662e..a9b668b4eb1a4 100644 --- a/maps/_gamemodes/packwar/mode_packwar_process.dm +++ b/maps/_gamemodes/packwar/mode_packwar_process.dm @@ -1,5 +1,5 @@ -/datum/game_mode/packwar/process() +/datum/game_mode/packwar/Process() if(ticker.current_state == GAME_STATE_PLAYING && world.time > time_next_mercenary_ship) time_next_mercenary_ship = world.time + rand(mercenary_interval_lower, mercenary_interval_upper) refresh_mercenaries() \ No newline at end of file diff --git a/maps/_gamemodes/slayer.dm b/maps/_gamemodes/slayer.dm index e572e4fffb284..20c44b7527728 100644 --- a/maps/_gamemodes/slayer.dm +++ b/maps/_gamemodes/slayer.dm @@ -68,7 +68,7 @@ H.set_species(new_species_name) outfit.equip(H) -/datum/game_mode/slayer/process() //Used to allow respawns after few minutes. Also auto-kills people after a threshold. +/datum/game_mode/slayer/Process() //Used to allow respawns after few minutes. Also auto-kills people after a threshold. if(world.time >= nextrespawn) auto_respawn() auto_kill() diff --git a/maps/_gamemodes/system_conquest/system_conquest.dm b/maps/_gamemodes/system_conquest/system_conquest.dm index b02d62cf3faf1..d49b6e0f63733 100644 --- a/maps/_gamemodes/system_conquest/system_conquest.dm +++ b/maps/_gamemodes/system_conquest/system_conquest.dm @@ -33,7 +33,7 @@ qdel(n) for(var/tag in CONSOLE_SPAWN_TAGS) loot_distributor.loot_list["[tag]"] = list(/obj/machinery/computer/capture_node/system_conquest) - loot_distributor.process() + loot_distributor.Process() /datum/game_mode/system_conquest/pre_setup() . = ..() @@ -77,7 +77,7 @@ active_objective = null next_objective_at = world.time + inter_objective_delay -/datum/game_mode/system_conquest/process() +/datum/game_mode/system_conquest/Process() . = ..() if(world.time < next_objective_at) return diff --git a/maps/base_assault_neutral_base/gm.dm b/maps/base_assault_neutral_base/gm.dm index c58e2bb412532..a927378a84499 100644 --- a/maps/base_assault_neutral_base/gm.dm +++ b/maps/base_assault_neutral_base/gm.dm @@ -81,7 +81,7 @@ do_display(GLOB.UNSC.living_minds,"HIGHCOMM",perc,perc_enemy,points_ours,points_enemy) do_display(GLOB.COVENANT.living_minds,"Local Command",perc_enemy,perc,points_enemy,points_ours) -/datum/game_mode/base_assault/neutral/process() +/datum/game_mode/base_assault/neutral/Process() . = ..() display_scores() diff --git a/maps/doisac/mercenaries_spawn.dm b/maps/doisac/mercenaries_spawn.dm index 470072be05ffa..2262c7ba20cf4 100644 --- a/maps/doisac/mercenaries_spawn.dm +++ b/maps/doisac/mercenaries_spawn.dm @@ -84,7 +84,7 @@ /obj/effect/landmark/mercspawn/New() . = ..() ship_area = locate(ship_area_type) in world - GLOB.processing_objects.Add(src) +START_PROCESSING(SSobj, src) dropship = new(src) /obj/effect/landmark/mercspawn/ram @@ -95,7 +95,7 @@ radio_channel = "BoulderNet" ship_area_type = /area/doisac_boulder_mercenary_ship -/obj/effect/landmark/mercspawn/process() +/obj/effect/landmark/mercspawn/Process() if(time_merc_dropoff && world.time > time_merc_dropoff) arrive_planet() diff --git a/maps/operation_trebuchet/insurrection_gm.dm b/maps/operation_trebuchet/insurrection_gm.dm index 0d6a6830be1cf..f54f6cbee9075 100644 --- a/maps/operation_trebuchet/insurrection_gm.dm +++ b/maps/operation_trebuchet/insurrection_gm.dm @@ -151,7 +151,7 @@ spawn(10 SECONDS) //Delay this for a little to allow for people to spawn in. inform_start_round() -/datum/game_mode/operation_trebuchet/process() +/datum/game_mode/operation_trebuchet/Process() ..() if(last_assault == BOMB_ACTIVE) //When the bomb's active, check much more frequently. update_bomb_status() diff --git a/maps/slayer/slayer_itemspawn_markers.dm b/maps/slayer/slayer_itemspawn_markers.dm index 5c69e75c92b1e..38ab878559034 100644 --- a/maps/slayer/slayer_itemspawn_markers.dm +++ b/maps/slayer/slayer_itemspawn_markers.dm @@ -12,12 +12,12 @@ /obj/effect/itemspawn_marker/Initialize() . = ..() - GLOB.processing_objects += src + START_PROCESSING(SSobj, src) /obj/effect/itemspawn_marker/ex_act() return -/obj/effect/itemspawn_marker/process() +/obj/effect/itemspawn_marker/Process() if(last_spawned_item) if(last_spawned_item.loc != get_turf(loc)) //.loc is intentionally used here to disallow standing on the spawn tile //whilst holding the item and other such things. @@ -39,7 +39,7 @@ new g.magazine_type (t) /obj/effect/itemspawn_marker/Destroy() - GLOB.processing_objects -= src + STOP_PROCESSING(SSobj, src) . = ..() //Marker Variants// diff --git a/maps/unsc_achlys/achlys_gamemode.dm b/maps/unsc_achlys/achlys_gamemode.dm index 574597a4a5f90..ebf8cfeac7275 100644 --- a/maps/unsc_achlys/achlys_gamemode.dm +++ b/maps/unsc_achlys/achlys_gamemode.dm @@ -180,7 +180,7 @@ All 3 of these cannot spawn on open space typepath_to_spawn = /obj/item/flood_spore_growing new typepath_to_spawn (pick(valid_spawns)) -/datum/game_mode/achlys/process() +/datum/game_mode/achlys/Process() ..() if(!has_configured) if(world.time >= mode_config_deadline) diff --git a/maps/unsc_achlys/achlys_gm.dm b/maps/unsc_achlys/achlys_gm.dm index 814ca32670cd0..dd36e22b0469a 100644 --- a/maps/unsc_achlys/achlys_gm.dm +++ b/maps/unsc_achlys/achlys_gm.dm @@ -124,7 +124,7 @@ All 3 of these cannot spawn on open space */ -/datum/game_mode/achlys/process() +/datum/game_mode/achlys/Process() ..() handle_comms_jamming() From 51026d27adf4ad4d9b5b85a3fd675c24a1434462 Mon Sep 17 00:00:00 2001 From: X0-11 Date: Mon, 3 Jun 2024 18:26:10 +0100 Subject: [PATCH 3/9] overheat fix --- code/modules/halo/weapons/gun_overheat.dm | 2 +- code/modules/mob/observer/virtual/base.dm | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/code/modules/halo/weapons/gun_overheat.dm b/code/modules/halo/weapons/gun_overheat.dm index 9817d7c85b2e9..ba3435e6c3451 100644 --- a/code/modules/halo/weapons/gun_overheat.dm +++ b/code/modules/halo/weapons/gun_overheat.dm @@ -62,7 +62,7 @@ else qdel(heat_bar) heat_bar = null - STOP_PROCESSING(SSobj, src) + STOP_PROCESSING(SSobj, src) /obj/item/weapon/gun/proc/overheat_sfx(var/origin) if(overheat_sfx) diff --git a/code/modules/mob/observer/virtual/base.dm b/code/modules/mob/observer/virtual/base.dm index 51f2e8d102314..762ec2107ad7c 100644 --- a/code/modules/mob/observer/virtual/base.dm +++ b/code/modules/mob/observer/virtual/base.dm @@ -70,4 +70,6 @@ var/list/all_virtual_listeners = list() return TRUE /mob/shall_have_virtual_mob() - return ispath(initial(virtual_mob)) + var/init_virt = initial(virtual_mob) + if(!isnull(init_virt)) + return ispath(init_virt) From 58815e30d68e861e0923da346691e2fd1ba24a44 Mon Sep 17 00:00:00 2001 From: X0-11 Date: Mon, 3 Jun 2024 20:25:13 +0100 Subject: [PATCH 4/9] nav data comp fix --- code/modules/halo/overmap/nav_data_computer.dm | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/code/modules/halo/overmap/nav_data_computer.dm b/code/modules/halo/overmap/nav_data_computer.dm index 766982a2e04c9..4e6e170e7b054 100644 --- a/code/modules/halo/overmap/nav_data_computer.dm +++ b/code/modules/halo/overmap/nav_data_computer.dm @@ -19,15 +19,11 @@ remove_nav_chip() qdel(chip_to_remove) -/obj/machinery/nav_computer/LateInitialize() - . = ..() - START_PROCESSING(SSobj, src) - /obj/machinery/nav_computer/Process() var/obj/effect/overmap/ship/our_om = map_sectors["[z]"] if(istype(our_om)) our_om.nav_comp = src - STOP_PROCESSING(SSobj, src) + STOP_PROCESSING(SSmachines, src) /obj/machinery/nav_computer/examine(var/mob/examiner) . = ..() From cb56a30d9a956a24f4f81fe4296ff6cdf05fdee8 Mon Sep 17 00:00:00 2001 From: X0-11 Date: Mon, 3 Jun 2024 20:43:06 +0100 Subject: [PATCH 5/9] further fixes --- code/_helpers/unsorted.dm | 4 ++-- code/controllers/Processes/chemistry.dm | 2 +- code/modules/halo/vehicles/vehiclebase.dm | 2 +- code/modules/mob/mob.dm | 4 ---- code/modules/mob/observer/virtual/base.dm | 7 +------ maps/_gamemodes/firefight/overmind.dm | 2 +- test/check-paths.sh | 2 +- 7 files changed, 7 insertions(+), 16 deletions(-) diff --git a/code/_helpers/unsorted.dm b/code/_helpers/unsorted.dm index b4211264320f3..b2a25757022d5 100644 --- a/code/_helpers/unsorted.dm +++ b/code/_helpers/unsorted.dm @@ -1134,9 +1134,9 @@ GLOBAL_DATUM_INIT(dview_mob, /mob/dview, new) set_light(origin.light_range, origin.light_power, origin.light_color) /mob/dview/Initialize() - ..() + . = ..() // We don't want to be in any mob lists; we're a dummy not a mob. - SSmobs.mob_list -= src + STOP_PROCESSING(SSmobs, src) // call to generate a stack trace and print to runtime logs /proc/crash_with(msg) diff --git a/code/controllers/Processes/chemistry.dm b/code/controllers/Processes/chemistry.dm index d749329e99fd1..9b9c653335873 100644 --- a/code/controllers/Processes/chemistry.dm +++ b/code/controllers/Processes/chemistry.dm @@ -7,7 +7,7 @@ var/datum/controller/process/chemistry/chemistryProcess /datum/controller/process/chemistry/setup() name = "chemistry" - schedule_interval = 20 // every 2 seconds + schedule_interval = 2 SECONDS chemistryProcess = src active_holders = list() chemical_reactions = chemical_reactions_list diff --git a/code/modules/halo/vehicles/vehiclebase.dm b/code/modules/halo/vehicles/vehiclebase.dm index b2d4368d5a421..4a6f45c12362c 100644 --- a/code/modules/halo/vehicles/vehiclebase.dm +++ b/code/modules/halo/vehicles/vehiclebase.dm @@ -328,7 +328,7 @@ var/list/drivers = get_occupants_in_position("driver") if(!drivers.len || isnull(drivers) || movement_destroyed) inactive_pilot_effects() - if(spawn_datum) + if(!isnull(spawn_datum) && !ispath(spawn_datum)) spawn_datum.process_resource_regen() /obj/vehicles/proc/update_object_sprites() //This is modified on a vehicle-by-vehicle basis to render mobsprites etc, a basic render of playerheads in the top right is used if no overidden. diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 5794719f3c1bb..d49f09036a77b 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -45,10 +45,6 @@ /mob/Initialize() . = ..() START_PROCESSING(SSmobs, src) - ..() - -/mob/Initialize() - . = ..() last_z = z var/obj/om_obj = map_sectors["[z]"] if(om_obj) diff --git a/code/modules/mob/observer/virtual/base.dm b/code/modules/mob/observer/virtual/base.dm index 762ec2107ad7c..affff40dbbfcc 100644 --- a/code/modules/mob/observer/virtual/base.dm +++ b/code/modules/mob/observer/virtual/base.dm @@ -67,9 +67,4 @@ var/list/all_virtual_listeners = list() return ..() /atom/movable/proc/shall_have_virtual_mob() - return TRUE - -/mob/shall_have_virtual_mob() - var/init_virt = initial(virtual_mob) - if(!isnull(init_virt)) - return ispath(init_virt) + return ispath(initial(virtual_mob)) diff --git a/maps/_gamemodes/firefight/overmind.dm b/maps/_gamemodes/firefight/overmind.dm index a14c2d962c53d..c27f5a0415218 100644 --- a/maps/_gamemodes/firefight/overmind.dm +++ b/maps/_gamemodes/firefight/overmind.dm @@ -11,7 +11,7 @@ /datum/npc_overmind/firefight/New() . = ..() -START_PROCESSING(SSobj, src) + START_PROCESSING(SSobj, src) /datum/npc_overmind/firefight/create_taskpoint_assign() //intentionally left blank diff --git a/test/check-paths.sh b/test/check-paths.sh index 3122b8d66bfd3..53e2cc24e2499 100755 --- a/test/check-paths.sh +++ b/test/check-paths.sh @@ -2,7 +2,7 @@ set -e WORLD_LOG_COUNT=40 -ANGLE_BRACKET_COUNT=730 +ANGLE_BRACKET_COUNT=731 FAILED=0 From 0fb3c4816e5546f06a7bfa50633fc2bed6fa5d08 Mon Sep 17 00:00:00 2001 From: X0-11 Date: Mon, 3 Jun 2024 21:22:13 +0100 Subject: [PATCH 6/9] indentation fixes --- code/game/machinery/alarm.dm | 4 ++-- code/game/objects/items/weapons/candle.dm | 2 +- code/game/objects/items/weapons/cigs_lighters.dm | 4 ++-- .../objects/items/weapons/implants/implants/death_alarm.dm | 2 +- code/game/objects/structures/crates_lockers/closets/statue.dm | 2 +- code/modules/assembly/timer.dm | 2 +- code/modules/clothing/head/misc_special.dm | 2 +- .../halo/covenant/structures_machines/energybarricade.dm | 2 +- code/modules/halo/covenant/structures_machines/weapon_rack.dm | 4 ++-- code/modules/halo/flood/flood_spawn.dm | 2 +- code/modules/halo/weapons/gun_overheat.dm | 2 +- code/modules/halo/weapons/landmine.dm | 2 +- code/modules/xenoarcheaology/tools/tools.dm | 2 +- maps/doisac/mercenaries_spawn.dm | 2 +- 14 files changed, 17 insertions(+), 17 deletions(-) diff --git a/code/game/machinery/alarm.dm b/code/game/machinery/alarm.dm index 88e56169387a4..e292842ef16fe 100644 --- a/code/game/machinery/alarm.dm +++ b/code/game/machinery/alarm.dm @@ -987,7 +987,7 @@ FIRE ALARM src.alarm() src.time = 0 src.timing = 0 - STOP_PROCESSING(SSobj, src) + STOP_PROCESSING(SSobj, src) src.updateDialog() last_process = world.timeofday @@ -1057,7 +1057,7 @@ FIRE ALARM else if (href_list["time"]) src.timing = text2num(href_list["time"]) last_process = world.timeofday - START_PROCESSING(SSobj, src) + START_PROCESSING(SSobj, src) else if (href_list["tp"]) var/tp = text2num(href_list["tp"]) src.time += tp diff --git a/code/game/objects/items/weapons/candle.dm b/code/game/objects/items/weapons/candle.dm index 6b41cf013c4e5..c064609b8834e 100644 --- a/code/game/objects/items/weapons/candle.dm +++ b/code/game/objects/items/weapons/candle.dm @@ -49,7 +49,7 @@ for(var/mob/O in viewers(usr, null)) O.show_message(flavor_text, 1) set_light(CANDLE_LUM) - START_PROCESSING(SSobj, src) + START_PROCESSING(SSobj, src) /obj/item/weapon/flame/candle/Process() diff --git a/code/game/objects/items/weapons/cigs_lighters.dm b/code/game/objects/items/weapons/cigs_lighters.dm index 2cb404b7188bb..5a767e7e11387 100644 --- a/code/game/objects/items/weapons/cigs_lighters.dm +++ b/code/game/objects/items/weapons/cigs_lighters.dm @@ -162,7 +162,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM var/turf/T = get_turf(src) T.visible_message(flavor_text) set_light(2, 0.25, "#E38F46") - START_PROCESSING(SSobj, src) + START_PROCESSING(SSobj, src) /obj/item/clothing/mask/smokable/proc/die(var/nomessage = 0) set_light(0) @@ -458,7 +458,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM user.visible_message("[user] puts out [src].", "You put out [src].") lit = 0 update_icon() - STOP_PROCESSING(SSobj, src) + STOP_PROCESSING(SSobj, src) else if (smoketime) var/turf/location = get_turf(user) user.visible_message("[user] empties out [src].", "You empty out [src].") diff --git a/code/game/objects/items/weapons/implants/implants/death_alarm.dm b/code/game/objects/items/weapons/implants/implants/death_alarm.dm index 6b1c32ec2da88..ebfd9c3c00e5f 100644 --- a/code/game/objects/items/weapons/implants/implants/death_alarm.dm +++ b/code/game/objects/items/weapons/implants/implants/death_alarm.dm @@ -57,7 +57,7 @@ meltdown() else if (prob(60)) //but more likely it will just quietly die malfunction = MALFUNCTION_PERMANENT - STOP_PROCESSING(SSobj, src) + STOP_PROCESSING(SSobj, src) spawn(20) malfunction = 0 diff --git a/code/game/objects/structures/crates_lockers/closets/statue.dm b/code/game/objects/structures/crates_lockers/closets/statue.dm index 65977c2fcf156..3a779964db892 100644 --- a/code/game/objects/structures/crates_lockers/closets/statue.dm +++ b/code/game/objects/structures/crates_lockers/closets/statue.dm @@ -55,7 +55,7 @@ M.setOxyLoss(intialOxy) if (timer <= 0) dump_contents() - STOP_PROCESSING(SSobj, src) + STOP_PROCESSING(SSobj, src) qdel(src) /obj/structure/closet/statue/dump_contents() diff --git a/code/modules/assembly/timer.dm b/code/modules/assembly/timer.dm index 4193d91f563d5..2140342dcfe9e 100644 --- a/code/modules/assembly/timer.dm +++ b/code/modules/assembly/timer.dm @@ -30,7 +30,7 @@ START_PROCESSING(SSobj, src) else timing = 0 - STOP_PROCESSING(SSobj, src) + STOP_PROCESSING(SSobj, src) update_icon() return secured diff --git a/code/modules/clothing/head/misc_special.dm b/code/modules/clothing/head/misc_special.dm index 485fb1cb4baa3..41afdfa09188a 100644 --- a/code/modules/clothing/head/misc_special.dm +++ b/code/modules/clothing/head/misc_special.dm @@ -136,7 +136,7 @@ src.damtype = "fire" src.icon_state = "cake1" src.item_state = "cake1" - START_PROCESSING(SSobj, src) + START_PROCESSING(SSobj, src) else src.force = null src.damtype = "brute" diff --git a/code/modules/halo/covenant/structures_machines/energybarricade.dm b/code/modules/halo/covenant/structures_machines/energybarricade.dm index 8c05b2c660699..d62553911fc34 100644 --- a/code/modules/halo/covenant/structures_machines/energybarricade.dm +++ b/code/modules/halo/covenant/structures_machines/energybarricade.dm @@ -165,7 +165,7 @@ if(!processing) processing = 1 - START_PROCESSING(SSobj, src) + START_PROCESSING(SSobj, src) /obj/structure/energybarricade/update_icon() var/shield_ratio = shield_health/max_shield diff --git a/code/modules/halo/covenant/structures_machines/weapon_rack.dm b/code/modules/halo/covenant/structures_machines/weapon_rack.dm index 1e7488146c497..2b187065433c5 100644 --- a/code/modules/halo/covenant/structures_machines/weapon_rack.dm +++ b/code/modules/halo/covenant/structures_machines/weapon_rack.dm @@ -38,7 +38,7 @@ charging_items.Add(I) if(!charging) charging = 1 - START_PROCESSING(SSobj, src) + START_PROCESSING(SSobj, src) return 1 else to_chat(user, "You can't fit \icon[I] onto [src].") @@ -83,4 +83,4 @@ if(!charging_items.len) charging = 0 - STOP_PROCESSING(SSobj, src) + STOP_PROCESSING(SSobj, src) diff --git a/code/modules/halo/flood/flood_spawn.dm b/code/modules/halo/flood/flood_spawn.dm index 61a4a54b8e586..bedd6742b1813 100644 --- a/code/modules/halo/flood/flood_spawn.dm +++ b/code/modules/halo/flood/flood_spawn.dm @@ -90,7 +90,7 @@ live_flood -= F if(!spawning) spawning = 1 - START_PROCESSING(SSobj, src) + START_PROCESSING(SSobj, src) time_next_respawn = world.time + respawn_delay /datum/flood_spawner/Destroy() diff --git a/code/modules/halo/weapons/gun_overheat.dm b/code/modules/halo/weapons/gun_overheat.dm index ba3435e6c3451..c7f4312855baa 100644 --- a/code/modules/halo/weapons/gun_overheat.dm +++ b/code/modules/halo/weapons/gun_overheat.dm @@ -52,7 +52,7 @@ if(heat_current > 0) if(!heat_bar) heat_bar = new (src.loc, overheat_capacity, src) - START_PROCESSING(SSobj, src) + START_PROCESSING(SSobj, src) heat_bar.update(heat_current) if(heat_current >= overheat_capacity) diff --git a/code/modules/halo/weapons/landmine.dm b/code/modules/halo/weapons/landmine.dm index d906e0af67051..75b5c63f8c866 100644 --- a/code/modules/halo/weapons/landmine.dm +++ b/code/modules/halo/weapons/landmine.dm @@ -59,7 +59,7 @@ /obj/item/device/landmine/proc/set_processing() if(!processing) processing = 1 - START_PROCESSING(SSobj, src) + START_PROCESSING(SSobj, src) /obj/item/device/landmine/proc/stop_processing() if(processing) diff --git a/code/modules/xenoarcheaology/tools/tools.dm b/code/modules/xenoarcheaology/tools/tools.dm index 954d407c07458..eeeb93280708d 100644 --- a/code/modules/xenoarcheaology/tools/tools.dm +++ b/code/modules/xenoarcheaology/tools/tools.dm @@ -250,7 +250,7 @@ var/obj/item/device/radio/target_radio /obj/item/device/beacon_locator/Initialize() - ..() + . = ..() START_PROCESSING(SSobj, src) /obj/item/device/beacon_locator/Destroy() diff --git a/maps/doisac/mercenaries_spawn.dm b/maps/doisac/mercenaries_spawn.dm index 2262c7ba20cf4..93b8e60a96ba5 100644 --- a/maps/doisac/mercenaries_spawn.dm +++ b/maps/doisac/mercenaries_spawn.dm @@ -84,7 +84,7 @@ /obj/effect/landmark/mercspawn/New() . = ..() ship_area = locate(ship_area_type) in world -START_PROCESSING(SSobj, src) + START_PROCESSING(SSobj, src) dropship = new(src) /obj/effect/landmark/mercspawn/ram From d3cff42b28eb449f7a4eca58e4e02bf1ff489c4c Mon Sep 17 00:00:00 2001 From: X0-11 Date: Mon, 3 Jun 2024 22:06:39 +0100 Subject: [PATCH 7/9] z vis del handling --- code/modules/multiz/turf.dm | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/code/modules/multiz/turf.dm b/code/modules/multiz/turf.dm index 6ca038366adf0..cc86b7f089edf 100644 --- a/code/modules/multiz/turf.dm +++ b/code/modules/multiz/turf.dm @@ -22,6 +22,22 @@ icon_state = "empty" plane = ABOVE_PLATING_PLANE layer = ABOVE_WIRE_LAYER + var/turf/simulated/open/parent + +/obj/effect/z_vis/New(var/p) + parent = p + ..() + +/obj/effect/z_vis/Initialize() + if(!parent) + return INITIALIZE_HINT_QDEL + . = ..() + +/obj/effect/z_vis/Destroy() + . = ..() + parent.vis_image = null + parent = null + vis_contents.Cut() /turf/simulated/open/CanZPass(atom/A, direction) if(locate(/obj/structure/catwalk, src)) @@ -50,7 +66,7 @@ plane = OBSCURITY_PLANE density = 0 pathweight = 100000 //Seriously, don't try and path over this one numbnuts - var/obj/effect/vis_image + var/obj/effect/z_vis/vis_image var/turf/below @@ -96,7 +112,7 @@ /turf/simulated/open/update_icon() if(!vis_image) - vis_image = new /obj/effect/z_vis (src) + vis_image = new (src) if(below && vis_image) vis_image.vis_contents += below From 638de2a0fa7b6983889de21a051006a2f00a6e21 Mon Sep 17 00:00:00 2001 From: X0-11 Date: Mon, 3 Jun 2024 22:37:10 +0100 Subject: [PATCH 8/9] qdel fixes --- code/game/machinery/computer/atmos_alert.dm | 2 +- code/game/machinery/newscaster.dm | 2 +- code/game/machinery/vending.dm | 7 ++++--- code/modules/atmospherics/components/tvalve.dm | 2 +- .../modules/atmospherics/components/unary/vent_scrubber.dm | 3 +-- code/modules/atmospherics/pipes.dm | 2 +- code/modules/halo/machinery/pointbased_vendor.dm | 2 +- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/code/game/machinery/computer/atmos_alert.dm b/code/game/machinery/computer/atmos_alert.dm index 245c4df970d00..678eb37920011 100644 --- a/code/game/machinery/computer/atmos_alert.dm +++ b/code/game/machinery/computer/atmos_alert.dm @@ -18,7 +18,7 @@ var/global/list/minor_air_alarms = list() /obj/machinery/computer/atmos_alert/Destroy() atmosphere_alarm.unregister_alarm(src) - ..() + . = ..() /obj/machinery/computer/atmos_alert/attack_hand(mob/user) ui_interact(user) diff --git a/code/game/machinery/newscaster.dm b/code/game/machinery/newscaster.dm index c4ac4d11bb400..c8454f0afa8f8 100644 --- a/code/game/machinery/newscaster.dm +++ b/code/game/machinery/newscaster.dm @@ -183,7 +183,7 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co /obj/machinery/newscaster/Destroy() allCasters -= src - ..() + . = ..() /obj/machinery/newscaster/update_icon() if(inoperable()) diff --git a/code/game/machinery/vending.dm b/code/game/machinery/vending.dm index 188f8f0fab103..323acc66ddca0 100644 --- a/code/game/machinery/vending.dm +++ b/code/game/machinery/vending.dm @@ -124,12 +124,13 @@ src.product_records.Add(product) /obj/machinery/vending/Destroy() - qdel(wires) + QDEL_NULL(wires) wires = null - qdel(coin) + QDEL_NULL(coin) coin = null for(var/R in product_records) - qdel(R) + product_records -= R + QDEL_NULL(R) product_records = null return ..() diff --git a/code/modules/atmospherics/components/tvalve.dm b/code/modules/atmospherics/components/tvalve.dm index fe70b54f87c79..bb1eb006b6953 100644 --- a/code/modules/atmospherics/components/tvalve.dm +++ b/code/modules/atmospherics/components/tvalve.dm @@ -116,7 +116,7 @@ node2 = null node3 = null - ..() + . = ..() /obj/machinery/atmospherics/tvalve/proc/go_to_side() diff --git a/code/modules/atmospherics/components/unary/vent_scrubber.dm b/code/modules/atmospherics/components/unary/vent_scrubber.dm index 674c6f6256abd..d6a6cce3681ab 100644 --- a/code/modules/atmospherics/components/unary/vent_scrubber.dm +++ b/code/modules/atmospherics/components/unary/vent_scrubber.dm @@ -42,8 +42,7 @@ /obj/machinery/atmospherics/unary/vent_scrubber/Destroy() unregister_radio(src, frequency) - ..() - + . = ..() /obj/machinery/atmospherics/unary/vent_scrubber/update_icon(var/safety = 0) if(!check_icon_cache()) diff --git a/code/modules/atmospherics/pipes.dm b/code/modules/atmospherics/pipes.dm index 65628186ddd30..ab77efe73d3c6 100644 --- a/code/modules/atmospherics/pipes.dm +++ b/code/modules/atmospherics/pipes.dm @@ -279,7 +279,7 @@ overlays += icon_manager.get_atmos_icon("pipe", , pipe_color, "[pipe_icon]exposed[node1?1:0][node2?1:0][icon_connect_type]") if(!leaking) leaking = 1 - START_PROCESSING(SSobj, src) + START_PROCESSING(SSmachines, src) /obj/machinery/atmospherics/pipe/simple/update_underlays() return diff --git a/code/modules/halo/machinery/pointbased_vendor.dm b/code/modules/halo/machinery/pointbased_vendor.dm index 9065b9265a904..ff38f5b757e3e 100644 --- a/code/modules/halo/machinery/pointbased_vendor.dm +++ b/code/modules/halo/machinery/pointbased_vendor.dm @@ -174,7 +174,7 @@ GLOBAL_LIST_INIT(mobs_to_reqdatum,list()) for(var/datum/stored_items/vending_products/R in product_records) qdel(R) product_records = null - return ..() + . = ..() /obj/machinery/pointbased_vending/ex_act(severity) return \ No newline at end of file From d995e181e2092d133e38a307cb02759295facaa6 Mon Sep 17 00:00:00 2001 From: X0-11 Date: Mon, 3 Jun 2024 22:50:41 +0100 Subject: [PATCH 9/9] npc ships ticker delay --- code/modules/halo/overmap/base_npc_ships.dm | 3 +++ code/modules/halo/overmap/overmap_effects.dm | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/code/modules/halo/overmap/base_npc_ships.dm b/code/modules/halo/overmap/base_npc_ships.dm index 1c16eb643e50b..3eebdfd05bf74 100644 --- a/code/modules/halo/overmap/base_npc_ships.dm +++ b/code/modules/halo/overmap/base_npc_ships.dm @@ -205,6 +205,9 @@ GLOBAL_LIST_INIT(om_base_sectors, list()) return ..() /obj/effect/overmap/ship/npc_ship/Process() + //Let's wait until gametime to do anything. + if(ticker.current_state != 3) + return //despawn after a while if(world.time >= unload_at && unload_at != 0) lose_to_space() diff --git a/code/modules/halo/overmap/overmap_effects.dm b/code/modules/halo/overmap/overmap_effects.dm index fb92df0a0a32c..74ff61ad49810 100644 --- a/code/modules/halo/overmap/overmap_effects.dm +++ b/code/modules/halo/overmap/overmap_effects.dm @@ -54,7 +54,7 @@ /datum/overmap_effect/proc/effect_created() /datum/overmap_effect/proc/process_effect() - if(world.time >= live_until) + if(world.time >= live_until || ticker.current_state != 3) return 0 return 1 @@ -114,7 +114,7 @@ if(!.) target.weapon_miss_chance = olddodge return - if(prob(GAS_CLOUD_EMP_CHANCE)) + if(prob(GAS_CLOUD_EMP_CHANCE) && target.map_z) var/turf/emp_center = locate(rand(target.map_bounds[1],target.map_bounds[3]),rand(target.map_bounds[2],target.map_bounds[4]),pick(target.map_z)) empulse(emp_center, rand(2, 7), rand(7, 14)) return 1
NameFingerprints
[H][md5(H.dna.uni_identity)]