Add hang_emerge_fix mod

This commit is contained in:
Nils Dagsson Moskopp 2022-05-11 22:00:01 +02:00
parent 217af233a7
commit 4487b802f5
Signed by: erle
GPG Key ID: A3BC671C35191080
2 changed files with 22 additions and 0 deletions

20
hang_emerge_fix/init.lua Normal file
View File

@ -0,0 +1,20 @@
local minetest_emerge_area = minetest.emerge_area
minetest.emerge_area = function(minp, maxp, ...)
if
minp.x >= 32767 or minp.x <= -32768 or
minp.y >= 32767 or minp.y <= -32768 or
minp.z >= 32767 or minp.z <= -32768 or
maxp.x >= 32767 or maxp.x <= -32768 or
maxp.y >= 32767 or maxp.y <= -32768 or
maxp.z >= 32767 or maxp.z <= -32768
then
minetest.log(
"warning",
"minetest.emerge_area() called with coords outside interval (-32768, 32767), skipping: " ..
"minp { x=" .. minp.x .. ", y=" .. minp.y .. " z=" .. minp.z .. " } " ..
"maxp { x=" .. maxp.x .. ", y=" .. maxp.y .. " z=" .. maxp.z .. " } "
)
else
return minetest.emerge_area(minp, maxp, ...)
end
end

2
hang_emerge_fix/mod.conf Normal file
View File

@ -0,0 +1,2 @@
name = hang_emerge_fix
description = Fix for minetest.emerge_area() hang