From b4202ea7796dc921320eb0fc97caf57ab061a7f6 Mon Sep 17 00:00:00 2001 From: nauta-turbidus <88062389+nauta-turbidus@users.noreply.github.com> Date: Sun, 6 Aug 2023 14:05:34 +0200 Subject: [PATCH] Trim trailing content when obtaining dedicated_server_step This change trims anything starting with the first space from dedicated_server_step, including single-line comments following the configured value specifically, before using it for calculations. It fixes compatibility-breaking crashes with some mods/games, which change the mentioned value by adding a comment after it. Such a comment is, as far as I know, syntactically valid, and is accepted by the engine it seems. --- worldedit/manipulations.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/worldedit/manipulations.lua b/worldedit/manipulations.lua index 3fe0f6f..112ca76 100644 --- a/worldedit/manipulations.lua +++ b/worldedit/manipulations.lua @@ -101,7 +101,7 @@ end local function deferred_execution(next_one, finished) -- Allocate 100% of server step for execution (might lag a little) local allocated_usecs = - tonumber(minetest.settings:get("dedicated_server_step")) * 1000000 + tonumber(minetest.settings:get("dedicated_server_step"):split(" ")[1]) * 1000000 local function f() local deadline = minetest.get_us_time() + allocated_usecs repeat