From 61059db67de6e56cd60d8464dc21fd85466cc27c Mon Sep 17 00:00:00 2001 From: Charlie Nolan Date: Sat, 6 Apr 2024 16:44:26 -0700 Subject: [PATCH] Make Delay saner. (#24873) * Make Delay saner. * Whoops, missed some uncommitted changes. * Apply review suggestion. * Update code/controllers/subsystem/SSticker.dm Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com> --------- Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com> --- code/controllers/subsystem/SSticker.dm | 3 ++- code/modules/admin/misc_admin_procs.dm | 14 ++++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/code/controllers/subsystem/SSticker.dm b/code/controllers/subsystem/SSticker.dm index d82b7a45c0b..f21fc79f495 100644 --- a/code/controllers/subsystem/SSticker.dm +++ b/code/controllers/subsystem/SSticker.dm @@ -82,7 +82,8 @@ SUBSYSTEM_DEF(ticker) if(GAME_STATE_STARTUP) // This is ran as soon as the MC starts firing, and should only run ONCE, unless startup fails round_start_time = world.time + (GLOB.configuration.general.lobby_time SECONDS) - to_chat(world, "Welcome to the pre-game lobby!") + pregame_timeleft = GLOB.configuration.general.lobby_time SECONDS + to_chat(world, "Welcome to the pre-game lobby!") to_chat(world, "Please, setup your character and select ready. Game will start in [GLOB.configuration.general.lobby_time] seconds") current_state = GAME_STATE_PREGAME fire() // TG says this is a good idea diff --git a/code/modules/admin/misc_admin_procs.dm b/code/modules/admin/misc_admin_procs.dm index 0609b8f91fd..407e954d339 100644 --- a/code/modules/admin/misc_admin_procs.dm +++ b/code/modules/admin/misc_admin_procs.dm @@ -508,6 +508,10 @@ GLOBAL_VAR_INIT(nologevent, 0) alert("Unable to start the game as it is not set up.") return + if(!SSticker.ticker_going) + alert("Remove the round-start delay first.") + return + if(GLOB.configuration.general.start_now_confirmation) if(alert(usr, "This is a live server. Are you sure you want to start now?", "Start game", "Yes", "No") != "Yes") return @@ -588,7 +592,14 @@ GLOBAL_VAR_INIT(nologevent, 0) if(!check_rights(R_SERVER)) return - if(!SSticker || SSticker.current_state != GAME_STATE_PREGAME) + if(!SSticker) + alert("Slow down a moment, let the ticker start first!") + return + + if(SSblackbox) + SSblackbox.record_feedback("tally", "admin_verb", 1, "Delay") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! + + if(SSticker.current_state > GAME_STATE_PREGAME) SSticker.delay_end = !SSticker.delay_end log_admin("[key_name(usr)] [SSticker.delay_end ? "delayed the round end" : "has made the round end normally"].") message_admins("[key_name(usr)] [SSticker.delay_end ? "delayed the round end" : "has made the round end normally"].", 1) @@ -604,7 +615,6 @@ GLOBAL_VAR_INIT(nologevent, 0) SSticker.ticker_going = TRUE to_chat(world, "The game will start soon.") log_admin("[key_name(usr)] removed the delay.") - SSblackbox.record_feedback("tally", "admin_verb", 1, "Delay") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! ////////////////////////////////////////////////////////////////////////////////////////////////ADMIN HELPER PROCS