projects
/
zefram
/
minetest
/
minetest_engine.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6090e95
)
Fix crash when teleporting near unknown node
author
BlockMen
<nmuelll@web.de>
Fri, 11 Apr 2014 19:38:16 +0000
(21:38 +0200)
committer
BlockMen
<nmuelll@web.de>
Fri, 11 Apr 2014 19:38:16 +0000
(21:38 +0200)
builtin/chatcommands.lua
patch
|
blob
|
history
diff --git
a/builtin/chatcommands.lua
b/builtin/chatcommands.lua
index 03c278d4d919df4fec29e6bda1a249a4f8abefbb..f8df83d8e2a8bef9fba33d79517d16ead48a1843 100644
(file)
--- a/
builtin/chatcommands.lua
+++ b/
builtin/chatcommands.lua
@@
-261,9
+261,12
@@
minetest.register_chatcommand("teleport", {
}
for _, d in ipairs(tries) do
local p = {x = pos.x+d.x, y = pos.y+d.y, z = pos.z+d.z}
- local n = minetest.get_node(p)
- if not minetest.registered_nodes[n.name].walkable then
- return p, true
+ local n = minetest.get_node_or_nil(p)
+ if n and n.name then
+ local def = minetest.registered_nodes[n.name]
+ if def and not def.walkable then
+ return p, true
+ end
end
end
return pos, false