default - revent knockback for attached players
* backported from default game
fbbc7fc996
This commit is contained in:
parent
d77ba194d4
commit
23eb8437f4
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user