mirror of
https://git.minetest.land/MineClone2/MineClone2.git
synced 2024-12-01 23:33:46 +01:00
Fixed player knockback from arrows
parent
46d9c66000
commit
1857341b59
@ -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 New Issue
Block a user