Skip to content

Commit

Permalink
Trim trailing content when obtaining dedicated_server_step
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
nauta-turbidus authored Aug 6, 2023
1 parent 689ff90 commit b4202ea
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion worldedit/manipulations.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b4202ea

Please sign in to comment.