From 42588282f84f381e1998aa991d6bf0d63f991e00 Mon Sep 17 00:00:00 2001 From: Mykhailo Bykhovtsev Date: Tue, 24 Dec 2019 09:03:18 -0800 Subject: [PATCH] Suspending different subsystems during explosion (#7760) --- code/controllers/controller.dm | 2 +- code/controllers/subsystems/air.dm | 6 +++ code/controllers/subsystems/machinery.dm | 7 ++++ code/controllers/subsystems/mob_ai.dm | 6 +++ .../subsystems/processing/processing.dm | 6 +++ html/changelogs/Sindorman-explosions.yml | 42 +++++++++++++++++++ 6 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 html/changelogs/Sindorman-explosions.yml diff --git a/code/controllers/controller.dm b/code/controllers/controller.dm index c31fca81748..9a80b36b739 100644 --- a/code/controllers/controller.dm +++ b/code/controllers/controller.dm @@ -14,7 +14,7 @@ // Called when SSexplosives begins processing explosions. /datum/controller/proc/ExplosionStart() - + // Called when SSexplosives finishes processing all queued explosions. /datum/controller/proc/ExplosionEnd() diff --git a/code/controllers/subsystems/air.dm b/code/controllers/subsystems/air.dm index eaa85a25d08..aeda1d0969b 100644 --- a/code/controllers/subsystems/air.dm +++ b/code/controllers/subsystems/air.dm @@ -438,3 +438,9 @@ Total Unsimulated Turfs: [world.maxx*world.maxy*world.maxz - simulated_turf_coun edges -= E if(!E.sleeping) active_edges -= E + +/datum/controller/subsystem/air/ExplosionStart() + suspend() + +/datum/controller/subsystem/air/ExplosionEnd() + wake() \ No newline at end of file diff --git a/code/controllers/subsystems/machinery.dm b/code/controllers/subsystems/machinery.dm index 0297414d108..53e9606a74b 100644 --- a/code/controllers/subsystems/machinery.dm +++ b/code/controllers/subsystems/machinery.dm @@ -221,4 +221,11 @@ if (remove_from_global) SSmachinery.all_machines -= M + +/datum/controller/subsystem/machinery/ExplosionStart() + suspend() + +/datum/controller/subsystem/machinery/ExplosionEnd() + wake() + #undef MACHINERY_GO_TO_NEXT diff --git a/code/controllers/subsystems/mob_ai.dm b/code/controllers/subsystems/mob_ai.dm index d381ff63668..0fc3845c83a 100644 --- a/code/controllers/subsystems/mob_ai.dm +++ b/code/controllers/subsystems/mob_ai.dm @@ -64,3 +64,9 @@ /mob/proc/on_think_enabled() return + +/datum/controller/subsystem/mob_ai/ExplosionStart() + suspend() + +/datum/controller/subsystem/mob_ai/ExplosionEnd() + wake() \ No newline at end of file diff --git a/code/controllers/subsystems/processing/processing.dm b/code/controllers/subsystems/processing/processing.dm index b989da7d9da..1ff5afc46d7 100644 --- a/code/controllers/subsystems/processing/processing.dm +++ b/code/controllers/subsystems/processing/processing.dm @@ -36,3 +36,9 @@ var/datum/controller/subsystem/processing/SSprocessing // Helper so PROCESS_KILL works. /datum/controller/subsystem/processing/proc/stop_processing(datum/D) STOP_PROCESSING(src, D) + +/datum/controller/subsystem/processing/ExplosionStart() + suspend() + +/datum/controller/subsystem/processing/ExplosionEnd() + wake() diff --git a/html/changelogs/Sindorman-explosions.yml b/html/changelogs/Sindorman-explosions.yml new file mode 100644 index 00000000000..bb7116da652 --- /dev/null +++ b/html/changelogs/Sindorman-explosions.yml @@ -0,0 +1,42 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# wip (For works in progress) +# tweak +# soundadd +# sounddel +# rscadd (general adding of nice things) +# rscdel (general deleting of nice things) +# imageadd +# imagedel +# maptweak +# spellcheck (typo fixes) +# experiment +# balance +# admin +# backend +# security +# refactor +################################# + +# Your name. +author: PoZe + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries. +# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog. +changes: + - tweak: "Big(14 tiles) explosions will no longer freeze the server." + - backend: "During explosions Air, Processing, Machinery, Mobs AI subsytems are temporrary suspended until explosions processing is finished."