mirror of
https://github.com/Uberi/Minetest-WorldEdit.git
synced 2024-12-04 13:23:43 +01:00
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.
This commit is contained in:
parent
689ff90a78
commit
b4202ea779
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user