Remove non-global references to SSgameMaster and SSevent_ticker

- Best practice to avoid holding onto references to the subsystem instances aside from the global variables. (In case of restart/recover etc).
- The reference to GM was entirely unused by any event or meta-event.  /datum/game_master would work fine using the global refs.
This commit is contained in:
Leshana
2020-04-06 17:21:30 -04:00
parent 8a8cd93db5
commit 31c634e334
5 changed files with 9 additions and 23 deletions

View File

@@ -23,7 +23,7 @@ SUBSYSTEM_DEF(event_ticker)
// Starts an event, independent of the GM system.
// This means it will always run, and won't affect the GM system in any way, e.g. not putting the event off limits after one use.
/datum/controller/subsystem/event_ticker/proc/start_event(event_type)
var/datum/event2/event/E = new event_type(src)
var/datum/event2/event/E = new event_type()
E.execute()
event_started(E)

View File

@@ -26,12 +26,12 @@ SUBSYSTEM_DEF(game_master)
/datum/controller/subsystem/game_master/Initialize()
var/list/subtypes = subtypesof(/datum/event2/meta)
for(var/T in subtypes)
var/datum/event2/meta/M = new T(src)
var/datum/event2/meta/M = new T()
if(!M.name)
continue
available_events += M
GM = new game_master_type(src)
GM = new game_master_type()
if(config && !config.enable_game_master)
can_fire = FALSE
@@ -137,7 +137,6 @@ SUBSYSTEM_DEF(game_master)
// This object makes the actual decisions.
/datum/game_master
var/datum/controller/subsystem/game_master/ticker = null
// Multiplier for how much 'danger' is accumulated. Higer generally makes it possible for more dangerous events to be picked.
var/danger_modifier = 1.0
@@ -150,9 +149,6 @@ SUBSYSTEM_DEF(game_master)
var/ignore_time_restrictions = FALSE // Useful for debugging without needing to wait 20 minutes each time.
var/ignore_round_chaos = FALSE // If true, the system will happily choose back to back intense events like meteors and blobs, Dwarf Fortress style.
/datum/game_master/New(datum/controller/subsystem/game_master/new_ticker)
ticker = new_ticker
/client/proc/show_gm_status()
set category = "Debug"
set name = "Show GM Status"