Restore Luanti < 5.10.0 compatibility

This commit is contained in:
SmallJoker 2025-02-09 12:19:22 +01:00
parent 733e263f86
commit 01c261cbe4

View File

@ -193,7 +193,8 @@ function areas:setPos1(name, pos)
end
if old_pos then
for object in core.objects_inside_radius(old_pos, 0.01) do
-- TODO: use `core.objects_inside_radius` after Luanti 5.10.0 is well established.
for _, object in ipairs(core.get_objects_inside_radius(old_pos, 0.01)) do
local luaentity = object:get_luaentity()
if luaentity and luaentity.name == "areas:pos1" and luaentity.player == name then
object:remove()
@ -216,7 +217,8 @@ function areas:setPos2(name, pos)
end
if old_pos then
for object in core.objects_inside_radius(old_pos, 0.01) do
-- TODO: use `core.objects_inside_radius` after Luanti 5.10.0 is well established.
for _, object in ipairs(core.get_objects_inside_radius(old_pos, 0.01)) do
local luaentity = object:get_luaentity()
if luaentity and luaentity.name == "areas:pos2" and luaentity.player == name then
object:remove()