sethome.get: Copy a return value
authorRui <rui.minetest@gmail.com>
Sat, 5 Nov 2016 02:17:05 +0000 (11:17 +0900)
committerAuke Kok <sofar+github@foo-projects.org>
Sun, 6 Nov 2016 02:59:15 +0000 (19:59 -0700)
mods/sethome/init.lua

index 4246f7a52baa4a611cd02aebf7d6302f9eb16688..28bfcef6c9f73f58d3093eb18c0018fdb3be5f53 100644 (file)
@@ -41,7 +41,12 @@ sethome.set = function(name, pos)
 end
 
 sethome.get = function(name)
-       return homepos[name]
+       local pos = homepos[name]
+       if pos then
+               return vector.new(pos)
+       else
+               return nil
+       end
 end
 
 sethome.go = function(name)