From c67d6a22a405f006a9d7a537dc35cecbdb65cfde Mon Sep 17 00:00:00 2001 From: Kyle Spier-Swenson Date: Mon, 5 Jun 2023 09:16:55 -0700 Subject: [PATCH] fix stupid error message in delay pre-game (#75824) tabbing out during init after hitting the verb, while you wait for the server to un-lockup and present you with the prompt, and coming back in, noticing you were too late, and cancelling out of the time prompt, only to get told the round had already started, was kinda fucking lame. I know, thats why i fucking hit cancel you fucking robit. also makes the proc more early return --- code/modules/admin/verbs/server.dm | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/code/modules/admin/verbs/server.dm b/code/modules/admin/verbs/server.dm index 45d5b525bf7..8c2a3aba722 100644 --- a/code/modules/admin/verbs/server.dm +++ b/code/modules/admin/verbs/server.dm @@ -202,20 +202,21 @@ set name = "Delay Pre-Game" var/newtime = input("Set a new time in seconds. Set -1 for indefinite delay.","Set Delay",round(SSticker.GetTimeLeft()/10)) as num|null + if(!newtime) + return if(SSticker.current_state > GAME_STATE_PREGAME) return tgui_alert(usr, "Too late... The game has already started!") - if(newtime) - newtime = newtime*10 - SSticker.SetTimeLeft(newtime) - SSticker.start_immediately = FALSE - if(newtime < 0) - to_chat(world, "The game start has been delayed.", confidential = TRUE) - log_admin("[key_name(usr)] delayed the round start.") - else - to_chat(world, "The game will start in [DisplayTimeText(newtime)].", confidential = TRUE) - SEND_SOUND(world, sound('sound/ai/default/attention.ogg')) - log_admin("[key_name(usr)] set the pre-game delay to [DisplayTimeText(newtime)].") - SSblackbox.record_feedback("tally", "admin_verb", 1, "Delay Game Start") // If you are copy-pasting this, ensure the 4th parameter is unique to the new proc! + newtime = newtime*10 + SSticker.SetTimeLeft(newtime) + SSticker.start_immediately = FALSE + if(newtime < 0) + to_chat(world, "The game start has been delayed.", confidential = TRUE) + log_admin("[key_name(usr)] delayed the round start.") + else + to_chat(world, "The game will start in [DisplayTimeText(newtime)].", confidential = TRUE) + SEND_SOUND(world, sound('sound/ai/default/attention.ogg')) + log_admin("[key_name(usr)] set the pre-game delay to [DisplayTimeText(newtime)].") + SSblackbox.record_feedback("tally", "admin_verb", 1, "Delay Game Start") // If you are copy-pasting this, ensure the 4th parameter is unique to the new proc! /datum/admins/proc/set_admin_notice() set category = "Server"