limit knockback to 32 (fixes android pause glitch)
This commit is contained in:
parent
792778e0f4
commit
ad2b727750
8
init.lua
8
init.lua
@ -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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user