Skip to content

Commit

Permalink
Add more verbose handling when a game mode start fails.
Browse files Browse the repository at this point in the history
Ticker will automatically try again once, otherwise it alerts admins or if there's no admins, changes to default game mode and initiates map vote
  • Loading branch information
Drulikar committed Jan 20, 2024
1 parent 6952fad commit 745cc5b
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion code/controllers/subsystem/ticker.dm
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,27 @@ SUBSYSTEM_DEF(ticker)

CHECK_TICK
if(!mode.can_start(bypass_checks))
to_chat(world, "Reverting to pre-game lobby.")
to_chat(world, "Requirements to start [GLOB.master_mode] not met. Reverting to pre-game lobby.")
// Make only one more attempt
if(world.time - 2 * wait > CONFIG_GET(number/lobby_countdown) SECONDS)
flash_clients()
delay_start = TRUE
var/active_admins = 0
for(var/client/admin_client in GLOB.admins)
if(!admin_client.is_afk() && check_client_rights(admin_client, R_SERVER, FALSE))
active_admins = TRUE
break
if(active_admins)
to_chat(world, SPAN_CENTERBOLD("The game start has been delayed."))
message_admins(SPAN_ADMINNOTICE("Alert: Insufficent players ready to start [GLOB.master_mode].\nEither change mode and map or start round and bypass checks."))
else
var/fallback_mode = CONFIG_GET(string/gamemode_default)
SSticker.save_mode(fallback_mode)
GLOB.master_mode = fallback_mode
to_chat(world, SPAN_BOLDNOTICE("Notice: The Gamemode for next round has been set to [fallback_mode]"))
handle_map_reboot()
else
to_chat(world, "Attempting again...")
QDEL_NULL(mode)
GLOB.RoleAuthority.reset_roles()
return FALSE
Expand Down

0 comments on commit 745cc5b

Please sign in to comment.