Skip to content

Commit

Permalink
config: allow disabling default SSweather events (ParadiseSS13#27300)
Browse files Browse the repository at this point in the history
* config: allow disabling default SSweather events

* Update config/example/config.toml

Co-authored-by: AffectedArc07 <[email protected]>
Signed-off-by: warriorstar-orion <[email protected]>

* debug log

---------

Signed-off-by: warriorstar-orion <[email protected]>
Co-authored-by: AffectedArc07 <[email protected]>
  • Loading branch information
warriorstar-orion and AffectedArc07 authored Nov 14, 2024
1 parent bff89a1 commit 8e47329
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@
var/revival_brain_life = 10 MINUTES
/// Enable random AI lawsets from the default=TRUE pool
var/random_ai_lawset = TRUE
/// Enable weather events initialized by SSweather. New weather events can still
/// be added during the round if this is disabled.
var/enable_default_weather_events = TRUE

/datum/configuration_section/general_configuration/load_data(list/data)
// Use the load wrappers here. That way the default isnt made 'null' if you comment out the config line
Expand Down Expand Up @@ -117,6 +120,7 @@
CONFIG_LOAD_BOOL(enable_night_shifts, data["enable_night_shifts"])
CONFIG_LOAD_BOOL(reactionary_explosions, data["reactionary_explosions"])
CONFIG_LOAD_BOOL(random_ai_lawset, data["random_ai_lawset"])
CONFIG_LOAD_BOOL(enable_default_weather_events, data["enable_default_weather_events"])

// Numbers
CONFIG_LOAD_NUM(lobby_time, data["lobby_time"])
Expand Down
4 changes: 4 additions & 0 deletions code/controllers/subsystem/SSweather.dm
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ SUBSYSTEM_DEF(weather)
next_hit_by_zlevel["[z]"] = world.time + randTime + initial(W.telegraph_duration)

/datum/controller/subsystem/weather/Initialize()
if(!GLOB.configuration.general.enable_default_weather_events)
log_debug("disabling default weather events due to configuration")
return

for(var/V in subtypesof(/datum/weather))
var/datum/weather/W = V
var/probability = initial(W.probability)
Expand Down
2 changes: 2 additions & 0 deletions config/example/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,8 @@ bomb_cap = 20
revival_brain_life = 6000 # 10 minutes
# Enable random silicon lawset (If said lawset has default = TRUE in the code). Disable for always crewsimov
random_ai_lawset = true
# Enable weather events initialized by SSweather. New weather events can still be added during the round if this is disabled.
enable_default_weather_events = true


################################################################
Expand Down

0 comments on commit 8e47329

Please sign in to comment.