mirror of
https://github.com/minetest-mods/areas.git
synced 2024-12-25 10:10:41 +01:00
Copy positions to avaoid multiple references
This commit is contained in:
parent
913e1fe6b3
commit
9871caf1e2
3
pos.lua
3
pos.lua
@ -123,6 +123,9 @@ function areas:getPos(playerName)
|
|||||||
if not (pos1 and pos2) then
|
if not (pos1 and pos2) then
|
||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
|
-- Copy positions so that the area table doesn't contain multiple
|
||||||
|
-- references to the same position.
|
||||||
|
pos1, pos2 = vector.new(pos1), vector.new(pos2)
|
||||||
return areas:sortPos(pos1, pos2)
|
return areas:sortPos(pos1, pos2)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user