Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix blank events being considered #1643

Merged
merged 1 commit into from
Apr 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading