From 8b9b4b00e55d8f73d121c1f11230b3c77ebc9937 Mon Sep 17 00:00:00 2001 From: ancientmarinerdev Date: Mon, 19 Jun 2023 17:51:02 +0100 Subject: [PATCH] Fix elytra crash when flying over unknown node --- mods/PLAYER/mcl_playerplus/init.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mods/PLAYER/mcl_playerplus/init.lua b/mods/PLAYER/mcl_playerplus/init.lua index 5836b6fe2..69cb00d07 100644 --- a/mods/PLAYER/mcl_playerplus/init.lua +++ b/mods/PLAYER/mcl_playerplus/init.lua @@ -239,10 +239,11 @@ minetest.register_globalstep(function(dtime) elytra.speed = 1 - (direction.y/2 + 0.5) 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 and not parent 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 is_just_jumped then -- move the player up when they start flying to give some clearance