mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-12-23 08:29:34 +01:00
Fixed player knockback from arrows
This commit is contained in:
parent
46d9c66000
commit
1857341b59
1 changed files with 7 additions and 1 deletions
|
@ -286,7 +286,13 @@ function minetest.calculate_knockback(player, hitter, time_from_last_punch, tool
|
|||
knockback = knockback + dir_dot * 2
|
||||
end
|
||||
elseif luaentity and luaentity._knockback then
|
||||
knockback = knockback + luaentity._knockback
|
||||
local kb = knockback + luaentity._knockback / 4
|
||||
local punch_dir = dir
|
||||
punch_dir.y = 0
|
||||
punch_dir = vector.normalize(punch_dir) * kb
|
||||
punch_dir.y = 4
|
||||
player:add_velocity(punch_dir)
|
||||
knockback = 0
|
||||
end
|
||||
return knockback
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue