mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2025-12-25 01:22:24 +00:00
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:
@@ -71,12 +71,12 @@
|
||||
// If no list is passed, all the events will be returned.
|
||||
/datum/game_master/default/proc/filter_events_by_departments(list/departments)
|
||||
. = list()
|
||||
for(var/E in ticker.available_events)
|
||||
for(var/E in SSgame_master.available_events)
|
||||
var/datum/event2/meta/event = E
|
||||
if(!event.enabled)
|
||||
continue
|
||||
if(event.chaotic_threshold && !ignore_round_chaos)
|
||||
if(ticker.danger > event.chaotic_threshold)
|
||||
if(SSgame_master.danger > event.chaotic_threshold)
|
||||
continue
|
||||
// An event has to involve all of these departments to pass.
|
||||
var/viable = TRUE
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
// * Does not react to danger at all.
|
||||
/datum/game_master/classic/choose_event()
|
||||
var/list/weighted_events = list()
|
||||
for(var/E in ticker.available_events)
|
||||
for(var/E in SSgame_master.available_events)
|
||||
var/datum/event2/meta/event = E
|
||||
if(!event.enabled)
|
||||
continue
|
||||
@@ -20,7 +20,7 @@
|
||||
// * Has no goals, and instead chooses randomly, ignoring weights.
|
||||
// * Does not react to danger at all.
|
||||
/datum/game_master/super_random/choose_event()
|
||||
return pick(ticker.available_events)
|
||||
return pick(SSgame_master.available_events)
|
||||
|
||||
|
||||
// The `brutal` game master tries to run dangerous events frequently.
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
/datum/game_master/brutal/choose_event()
|
||||
var/list/weighted_events = list()
|
||||
for(var/E in ticker.available_events)
|
||||
for(var/E in SSgame_master.available_events)
|
||||
var/datum/event2/meta/event = E
|
||||
if(!event.enabled)
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user