From 01c261cbe44cdf13d716725eb0a0e1a24bacd2c0 Mon Sep 17 00:00:00 2001 From: SmallJoker Date: Sun, 9 Feb 2025 12:19:22 +0100 Subject: [PATCH] Restore Luanti < 5.10.0 compatibility --- pos.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pos.lua b/pos.lua index c24c3d6..aa8aba5 100644 --- a/pos.lua +++ b/pos.lua @@ -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()