limit knockback to 32 (fixes android pause glitch)

This commit is contained in:
tenplus1 2021-07-22 10:09:05 +01:00
parent 792778e0f4
commit ad2b727750

View File

@ -291,13 +291,15 @@ local punchy = function(
end
-- END tool damage
-- print ("---", player:get_player_name(), damage)
local kb = math.min(32, damage * 2)
-- print ("---", player:get_player_name(), damage, kb)
-- knock back player
player:add_velocity({
x = dir.x * (damage * 2),
x = dir.x * kb,
y = -1,
z = dir.z * (damage * 2)
z = dir.z * kb
})
end