Skip to content

Commit

Permalink
Merge pull request #3447 from MistakeNot4892/modes
Browse files Browse the repository at this point in the history
Fixes runtimes with secret mode selection.
  • Loading branch information
out-of-phaze authored Oct 16, 2023
2 parents 030b555 + 5edd72f commit 1f8e624
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions code/controllers/subsystems/ticker.dm
Original file line number Diff line number Diff line change
Expand Up @@ -227,16 +227,16 @@ Helpers
if((mode_to_try=="random") || (mode_to_try=="secret"))
var/list/runnable_modes = base_runnable_modes - bad_modes
if(secret_force_mode != "secret") // Config option to force secret to be a specific mode.
mode_datum = decls_repository.get_decl_by_id(secret_force_mode)
mode_datum = decls_repository.get_decl_by_id(secret_force_mode, validate_decl_type = FALSE)
else if(!length(runnable_modes)) // Indicates major issues; will be handled on return.
bad_modes += mode_to_try
return
else
mode_datum = decls_repository.get_decl_by_id(pickweight(runnable_modes))
mode_datum = decls_repository.get_decl_by_id(pickweight(runnable_modes), validate_decl_type = FALSE)
if(length(runnable_modes) > 1) // More to pick if we fail; we won't tell anyone we failed unless we fail all possibilities, though.
. = CHOOSE_GAMEMODE_SILENT_REDO
else
mode_datum = decls_repository.get_decl_by_id(mode_to_try)
mode_datum = decls_repository.get_decl_by_id(mode_to_try, validate_decl_type = FALSE)
if(!istype(mode_datum))
bad_modes += mode_to_try
return
Expand All @@ -261,7 +261,7 @@ Helpers
to_world("<B>The current game mode is Secret!</B>")
var/list/mode_names = list()
for (var/mode_tag in base_runnable_modes)
var/decl/game_mode/M = decls_repository.get_decl_by_id(mode_tag)
var/decl/game_mode/M = decls_repository.get_decl_by_id(mode_tag, validate_decl_type = FALSE)
if(M)
mode_names += M.name
if (config.secret_hide_possibilities)
Expand Down
2 changes: 1 addition & 1 deletion code/datums/cinematic.dm
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ var/global/datum/cinematic/cinematic = new
if(!override)
override = SSticker.mode
if(!override)
override = decls_repository.get_decl_by_id("extended")
override = GET_DECL(/decl/game_mode/extended)
if(!override)
return

Expand Down
2 changes: 1 addition & 1 deletion code/datums/vote/gamemode.dm
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
..()
choices += config.votable_modes
for (var/F in choices)
var/decl/game_mode/M = decls_repository.get_decl_by_id(F)
var/decl/game_mode/M = decls_repository.get_decl_by_id(F, validate_decl_type = FALSE)
if(!M)
continue
display_choices[F] = capitalize(M.name)
Expand Down

0 comments on commit 1f8e624

Please sign in to comment.