mirror of
				https://github.com/Uberi/Minetest-WorldEdit.git
				synced 2025-11-04 06:35:28 +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:
		@@ -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
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user