Skip to content

Commit

Permalink
Fix blank events being considered
Browse files Browse the repository at this point in the history
  • Loading branch information
Absolucy committed Apr 12, 2024
1 parent d48cb59 commit e92cf57
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
11 changes: 7 additions & 4 deletions code/controllers/subsystem/events.dm
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,13 @@ SUBSYSTEM_DEF(events)
var/wizardmode = FALSE

/datum/controller/subsystem/events/Initialize()
for(var/type in typesof(/datum/round_event_control))
var/datum/round_event_control/event = new type()
if(!event.typepath || !event.valid_for_map())
continue //don't want this one! leave it for the garbage collector
for(var/datum/round_event_control/event_type as anything in typesof(/datum/round_event_control))
if(!event_type::typepath || !event_type::name)
continue
var/datum/round_event_control/event = new event_type
if(!event.valid_for_map())
qdel(event)
continue
control += event //add it to the list of all events (controls)
reschedule()
// Instantiate our holidays list if it hasn't been already
Expand Down
9 changes: 5 additions & 4 deletions monkestation/code/modules/storytellers/gamemode_subsystem.dm
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,12 @@ SUBSYSTEM_DEF(gamemode)
for(var/type in subtypesof(/datum/storyteller))
storytellers[type] = new type()

for(var/type in typesof(/datum/round_event_control))
var/datum/round_event_control/event = new type()
if(!event.typepath || !event.name)
continue //don't want this one! leave it for the garbage collector
for(var/datum/round_event_control/event_type as anything in typesof(/datum/round_event_control))
if(!event_type::typepath || !event_type::name)
continue
var/datum/round_event_control/event = new event_type
if(!event.valid_for_map())
qdel(event)
continue // event isn't good for this map no point in trying to add it to the list
control += event //add it to the list of all events (controls)
getHoliday()
Expand Down

0 comments on commit e92cf57

Please sign in to comment.