Use fly_into_wall damage type for elytra damage

This commit is contained in:
Elias Fleckenstein 2021-04-27 20:56:53 +02:00
parent 79aac4c494
commit 819d59dbe7

View file

@ -166,11 +166,11 @@ minetest.register_globalstep(function(dtime)
and (fly_node == "air" or fly_node == "ignore") and (fly_node == "air" or fly_node == "ignore")
if elytra.active then if elytra.active then
if player_velocity.x < (player_velocity_old.x - 10) or player_velocity.x > (player_velocity_old.x + 10) then if player_velocity.x < (player_velocity_old.x - 10) or player_velocity.x > (player_velocity_old.x + 10) and fly_node ~= "ignore" then
player:set_hp(player:get_hp() - (math.abs(player_velocity_old.x) * 0.2)) mcl_util.deal_damage(player, math.abs(player_velocity_old.x) * 0.2, {type = "fly_into_wall"})
end end
if player_velocity.z < (player_velocity_old.z - 10) or player_velocity.z > (player_velocity_old.z + 10) then if player_velocity.z < (player_velocity_old.z - 10) or player_velocity.z > (player_velocity_old.z + 10) and fly_node ~= "ignore" then
player:set_hp(player:get_hp() - (math.abs(player_velocity_old.z) * 0.2)) mcl_util.deal_damage(player, math.abs(player_velocity_old.z) * 0.2, {type = "fly_into_wall"})
end end
mcl_player.player_set_animation(player, "fly") mcl_player.player_set_animation(player, "fly")
if player_velocity.y < -1.5 then if player_velocity.y < -1.5 then