/shutdown can't do countdown when using reconnect and/or shutdown message (#7055)
authordopik <33575686+dopik@users.noreply.github.com>
Mon, 19 Feb 2018 07:41:44 +0000 (08:41 +0100)
committerLoïc Blot <nerzhul@users.noreply.github.com>
Mon, 19 Feb 2018 07:41:44 +0000 (08:41 +0100)
Delay was converted from the param string and not the delay value, thus never using the actual given delay value when used in combination with other string values in the param, in this case reconnect and the shutdown messsage.

builtin/game/chatcommands.lua

index 136e45a9a8ab5d6c1ea8399176fa248650431df9..e349eec7ed9dc22e59b4b0ec213bd6ff6e3f1bc9 100644 (file)
@@ -828,7 +828,7 @@ core.register_chatcommand("shutdown", {
                message = message or ""
 
                if delay ~= "" then
-                       delay = tonumber(param) or 0
+                       delay = tonumber(delay) or 0
                else
                        delay = 0
                        core.log("action", name .. " shuts down server")