default - revent knockback for attached players

* backported from default game
  fbbc7fc996
This commit is contained in:
mckaygerhard 2023-08-06 13:02:58 -04:00
parent da95192b0e
commit ea7c18886f

View File

@ -136,6 +136,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