mirror of
https://git.minetest.land/MineClone2/MineClone2.git
synced 2025-01-06 08:37:30 +01:00
Guard against undefined nodes
This commit is contained in:
parent
363187b0d6
commit
46ea9e98cc
@ -385,7 +385,7 @@ local function do_movement_step(staticdata, dtime)
|
|||||||
if staticdata.distance == 0 then
|
if staticdata.distance == 0 then
|
||||||
local next_node = core.get_node(staticdata.connected_at + staticdata.dir)
|
local next_node = core.get_node(staticdata.connected_at + staticdata.dir)
|
||||||
local next_node_def = core.registered_nodes[next_node.name]
|
local next_node_def = core.registered_nodes[next_node.name]
|
||||||
if next_node_def and next_node_def.groups and (next_node_def.groups.solid or next_node_def.groups.stair) then
|
if not next_node_def or next_node_def.groups and (next_node_def.groups.solid or next_node_def.groups.stair) then
|
||||||
reverse_direction(staticdata)
|
reverse_direction(staticdata)
|
||||||
return 0
|
return 0
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user