mirror of
https://github.com/ElCeejo/animalia.git
synced 2025-04-30 13:31:39 -04:00
Merge 696a051ad5
into 259e741282
This commit is contained in:
commit
7d7c6e1c16
1 changed files with 8 additions and 6 deletions
|
@ -591,12 +591,14 @@ function animalia.action_melee(self, target)
|
|||
if stage == 2
|
||||
and dist < mob.width + 1 then
|
||||
mob:punch_target(target)
|
||||
local knockback = minetest.calculate_knockback(
|
||||
target, mob.object, 1.0,
|
||||
{damage_groups = {fleshy = mob.damage}},
|
||||
dir, 2.0, mob.damage
|
||||
)
|
||||
target:add_velocity({x = dir.x * knockback, y = dir.y * knockback, z = dir.z * knockback})
|
||||
if target:get_pos() then -- target may have died and disappeared
|
||||
local knockback = minetest.calculate_knockback(
|
||||
target, mob.object, 1.0,
|
||||
{damage_groups = {fleshy = mob.damage}},
|
||||
dir, 2.0, mob.damage
|
||||
)
|
||||
target:add_velocity({x = dir.x * knockback, y = dir.y * knockback, z = dir.z * knockback})
|
||||
end
|
||||
|
||||
stage = 3
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue