mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-26 12:31:05 +01:00
Fix not being able to give minimum knockback to players when both near and lower than them
This commit is contained in:
parent
8e2c5249f5
commit
d7b10d18d8
1 changed files with 8 additions and 6 deletions
|
@ -286,12 +286,14 @@ function minetest.calculate_knockback(player, hitter, time_from_last_punch, tool
|
|||
-- add vertical lift to knockback
|
||||
local v = player:get_velocity()
|
||||
local invul = player:get_meta():get_int("mcl_damage:invulnerable")
|
||||
if v and v.y <= 0.1 and v.y >= -0.1 and dir.y <= 0.44 and invul == 0 then
|
||||
player:add_velocity({
|
||||
x = 0,
|
||||
y = 4.5,
|
||||
z = 0
|
||||
})
|
||||
if v and v.y <= 0.1 and v.y >= -0.1 and invul == 0 then
|
||||
if dir.y <= 0.44 then
|
||||
player:add_velocity({
|
||||
x = 0,
|
||||
y = 4.5,
|
||||
z = 0
|
||||
})
|
||||
end
|
||||
-- add minimum knockback
|
||||
if knockback <= 1.5 then
|
||||
knockback = knockback + 4.875
|
||||
|
|
Loading…
Reference in a new issue