projects
/
oweals
/
minetest.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ba52a34
)
Builtin/../falling.lua: Avoid crash when object pos over limit
author
paramat
<mat.gregory@virginmedia.com>
Wed, 21 Dec 2016 07:10:32 +0000
(07:10 +0000)
committer
paramat
<mat.gregory@virginmedia.com>
Wed, 21 Dec 2016 13:30:10 +0000
(13:30 +0000)
If the object pos is over limit, 'add entity' will not add an entity,
causing 'obj' to be nil.
builtin/game/falling.lua
patch
|
blob
|
history
diff --git
a/builtin/game/falling.lua
b/builtin/game/falling.lua
index 8b88b68d83668d8a627f88ea38cde85bde148f08..4696ce4818ffd9e279ccc5d600f2efd8a48ca47c 100644
(file)
--- a/
builtin/game/falling.lua
+++ b/
builtin/game/falling.lua
@@
-113,7
+113,9
@@
core.register_entity(":__builtin:falling_node", {
local function spawn_falling_node(p, node)
local obj = core.add_entity(p, "__builtin:falling_node")
- obj:get_luaentity():set_node(node)
+ if obj then
+ obj:get_luaentity():set_node(node)
+ end
end
local function drop_attached_node(p)