Skip to content

Commit a106bfd

Browse files
author
benrob0329
authoredApr 13, 2021
Also return the ObjectRef from minetest.spawn_falling_node() (#11184)
1 parent bbe1203 commit a106bfd

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed
 

Diff for: ‎builtin/game/falling.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ local function convert_to_falling_node(pos, node)
407407

408408
obj:get_luaentity():set_node(node, metatable)
409409
core.remove_node(pos)
410-
return true
410+
return true, obj
411411
end
412412

413413
function core.spawn_falling_node(pos)

Diff for: ‎doc/lua_api.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -4927,7 +4927,7 @@ Environment access
49274927
* Punch node with the same effects that a player would cause
49284928
* `minetest.spawn_falling_node(pos)`
49294929
* Change node into falling node
4930-
* Returns `true` if successful, `false` on failure
4930+
* Returns `true` and the ObjectRef of the spawned entity if successful, `false` on failure
49314931

49324932
* `minetest.find_nodes_with_meta(pos1, pos2)`
49334933
* Get a table of positions of nodes that have metadata within a region

0 commit comments

Comments
 (0)
Please sign in to comment.