forked from VoxeLibre/VoxeLibre
Fix elytra crash when flying over unknown node
This commit is contained in:
parent
7d51519f4d
commit
8b9b4b00e5
|
@ -239,10 +239,11 @@ minetest.register_globalstep(function(dtime)
|
||||||
elytra.speed = 1 - (direction.y/2 + 0.5)
|
elytra.speed = 1 - (direction.y/2 + 0.5)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local fly_node_walkable = minetest.registered_nodes[fly_node] and minetest.registered_nodes[fly_node].walkable
|
||||||
elytra.active = minetest.get_item_group(player:get_inventory():get_stack("armor", 3):get_name(), "elytra") ~= 0
|
elytra.active = minetest.get_item_group(player:get_inventory():get_stack("armor", 3):get_name(), "elytra") ~= 0
|
||||||
and not parent
|
and not parent
|
||||||
and (elytra.active or (is_just_jumped and player_velocity.y < -0))
|
and (elytra.active or (is_just_jumped and player_velocity.y < -0))
|
||||||
and ((not minetest.registered_nodes[fly_node].walkable) or fly_node == "ignore")
|
and ((not fly_node_walkable) or fly_node == "ignore")
|
||||||
|
|
||||||
if elytra.active then
|
if elytra.active then
|
||||||
if is_just_jumped then -- move the player up when they start flying to give some clearance
|
if is_just_jumped then -- move the player up when they start flying to give some clearance
|
||||||
|
|
Loading…
Reference in New Issue