diff --git a/mods/default/player.lua b/mods/default/player.lua index 7179e8e..f7c34ab 100644 --- a/mods/default/player.lua +++ b/mods/default/player.lua @@ -135,6 +135,15 @@ end) local player_set_animation = default.player_set_animation local player_attached = default.player_attached +-- Prevent knockback for attached players +local old_calculate_knockback = minetest.calculate_knockback +function minetest.calculate_knockback(player, ...) + if player_attached[player:get_player_name()] then + return 0 + end + return old_calculate_knockback(player, ...) +end + -- Check each player and apply animations minetest.register_globalstep(function(dtime) for _, player in pairs(minetest.get_connected_players()) do