From 9bcade977606d8ec6c31c183027ca5106074c30d Mon Sep 17 00:00:00 2001 From: NyakoFox Date: Wed, 25 Feb 2026 20:27:08 -0400 Subject: [PATCH] Add statedelay argument to `gamestate` command The `gamestate` command has an argument to set the gamestate, but the statedelay was always set to 0, despite the statedelay being an important part of the gamestate system. This commit adds an optional argument to set the statedelay. --- desktop_version/src/Script.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/desktop_version/src/Script.cpp b/desktop_version/src/Script.cpp index 95bccf71..f4026df0 100644 --- a/desktop_version/src/Script.cpp +++ b/desktop_version/src/Script.cpp @@ -1346,7 +1346,14 @@ void scriptclass::run(void) { // Allow the gamestate command to bypass statelock, at least for now game.state = ss_toi(words[1]); - game.statedelay = 0; + if (argexists[2]) + { + game.statedelay = ss_toi(words[2]); + } + else + { + game.statedelay = 0; + } } else if (words[0] == "textboxactive") {