From 006b61f08bd360846779d359fe7c8f699c22dedf Mon Sep 17 00:00:00 2001 From: ArcaneMusic <41715314+ArcaneMusic@users.noreply.github.com> Date: Thu, 11 Jan 2024 00:23:19 -0500 Subject: [PATCH] Adds a Debug command to stop all weather. (#80848) Atomizing out of #78524 as a result of that PR being too big and this was quite easy to do. ## About The Pull Request This adds a debug (admin) command that allows you to stop all weather effects that are going on across the map in a given instance. This is useful for when you are testing something on lavaland and need the storm to stop, or if you otherwise had some other kind of weather effect interfering with testing something. It's worth noting this directly calls end() on the active weather effect, meaning that for more complicated weather that may have different side effects, it may need some extra finess, but as of current writing no weather does anything interesting in their wind_down() procs. ## Why It's Good For The Game God weather is so annoying while testing lavaland, plus this is just straight admin and testing tooling so there's no harm. ## Changelog :cl: admin: Added a new admin verb that ends all active weather within the weather subsystem. /:cl: --- code/controllers/subsystem/weather.dm | 14 ++++++++++++++ code/modules/admin/admin_verbs.dm | 1 + 2 files changed, 15 insertions(+) diff --git a/code/controllers/subsystem/weather.dm b/code/controllers/subsystem/weather.dm index b78beeed815..78c99f47903 100644 --- a/code/controllers/subsystem/weather.dm +++ b/code/controllers/subsystem/weather.dm @@ -85,3 +85,17 @@ SUBSYSTEM_DEF(weather) ///Returns an active storm by its type /datum/controller/subsystem/weather/proc/get_weather_by_type(type) return locate(type) in processing + +/** + * Calls end() on all current weather effects that are currently processing in the weather subsystem. + */ +/client/proc/stop_weather() + set category = "Debug" + set name = "Stop All Active Weather" + + log_admin("[key_name(src)] stopped all currently active weather.") + message_admins("[key_name_admin(src)] stopped all currently active weather.") + for(var/datum/weather/current_weather as anything in SSweather.processing) + if(current_weather in SSweather.processing) + current_weather.end() + BLACKBOX_LOG_ADMIN_VERB("Stop All Active Weather") diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index 988d4c15b26..7bff29bc32c 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -233,6 +233,7 @@ GLOBAL_PROTECT(admin_verbs_debug) /client/proc/validate_puzzgrids, /client/proc/GeneratePipeSpritesheet, /client/proc/view_runtimes, + /client/proc/stop_weather, ) GLOBAL_LIST_INIT(admin_verbs_possess, list(/proc/possess, /proc/release)) GLOBAL_PROTECT(admin_verbs_possess)