mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-16 16:11:06 +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
|
knockback = knockback + dir_dot * 2
|
||||||
end
|
end
|
||||||
elseif luaentity and luaentity._knockback then
|
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
|
end
|
||||||
return knockback
|
return knockback
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue