From 819d59dbe703a62491a5e58bcfada560fd850615 Mon Sep 17 00:00:00 2001 From: Elias Fleckenstein Date: Tue, 27 Apr 2021 20:56:53 +0200 Subject: [PATCH] Use fly_into_wall damage type for elytra damage --- mods/PLAYER/mcl_playerplus/init.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mods/PLAYER/mcl_playerplus/init.lua b/mods/PLAYER/mcl_playerplus/init.lua index 08cecd615..9436ae94d 100644 --- a/mods/PLAYER/mcl_playerplus/init.lua +++ b/mods/PLAYER/mcl_playerplus/init.lua @@ -166,11 +166,11 @@ minetest.register_globalstep(function(dtime) and (fly_node == "air" or fly_node == "ignore") if elytra.active then - if player_velocity.x < (player_velocity_old.x - 10) or player_velocity.x > (player_velocity_old.x + 10) then - player:set_hp(player:get_hp() - (math.abs(player_velocity_old.x) * 0.2)) + if player_velocity.x < (player_velocity_old.x - 10) or player_velocity.x > (player_velocity_old.x + 10) and fly_node ~= "ignore" then + mcl_util.deal_damage(player, math.abs(player_velocity_old.x) * 0.2, {type = "fly_into_wall"}) end - if player_velocity.z < (player_velocity_old.z - 10) or player_velocity.z > (player_velocity_old.z + 10) then - player:set_hp(player:get_hp() - (math.abs(player_velocity_old.z) * 0.2)) + if player_velocity.z < (player_velocity_old.z - 10) or player_velocity.z > (player_velocity_old.z + 10) and fly_node ~= "ignore" then + mcl_util.deal_damage(player, math.abs(player_velocity_old.z) * 0.2, {type = "fly_into_wall"}) end mcl_player.player_set_animation(player, "fly") if player_velocity.y < -1.5 then