Disable knockback when PVP disabled (#8)

master
fluxionary 2022-05-14 09:18:40 -07:00 committed by GitHub
parent b84810f6c3
commit 4c4836134b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -148,3 +148,11 @@ minetest.register_on_punchplayer(function(player, hitter, time_from_last_punch,
end
return false
end)
local old_calculate_knockback = minetest.calculate_knockback
function minetest.calculate_knockback(player, hitter, ...)
if not pvpplus.is_pvp(player:get_player_name()) or not pvpplus.is_pvp(hitter:get_player_name()) then
return 0
end
return old_calculate_knockback(player, hitter, ...)
end