summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShadowNinja <shadowninja@minetest.net>2014-07-15 15:41:18 -0400
committerShadowNinja <shadowninja@minetest.net>2014-07-15 15:41:18 -0400
commit9871caf1e28e3a22bba1323fe6a976a7faedde44 (patch)
tree9dcaf3f9eca59e7b7cd28ff58c0995b086d3803d
parent913e1fe6b3f46ab6163067fab44fe2cc77363803 (diff)
Copy positions to avaoid multiple references
-rw-r--r--pos.lua3
1 files changed, 3 insertions, 0 deletions
diff --git a/pos.lua b/pos.lua
index 40f8360..8d3e6fe 100644
--- a/pos.lua
+++ b/pos.lua
@@ -123,6 +123,9 @@ function areas:getPos(playerName)
if not (pos1 and pos2) then
return nil
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)
end