Skip to content

Commit

Permalink
Restore Luanti < 5.10.0 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
SmallJoker committed Feb 9, 2025
1 parent 733e263 commit 01c261c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pos.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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()
Expand Down

0 comments on commit 01c261c

Please sign in to comment.