forked from VoxeLibre/VoxeLibre
Prevent dying mobs from catapulting to strong knockbacks like bow/arrows with Punch II
This commit is contained in:
parent
401c05d696
commit
fbdbeed94b
|
@ -728,8 +728,10 @@ function mob_class:on_punch(hitter, tflp, tool_capabilities, dir)
|
||||||
if dir_dot > 0 and mob_mag <= player_mag * 0.625 then
|
if dir_dot > 0 and mob_mag <= player_mag * 0.625 then
|
||||||
kb = kb + ((math.abs(hv.x) + math.abs(hv.z)) * r)
|
kb = kb + ((math.abs(hv.x) + math.abs(hv.z)) * r)
|
||||||
end
|
end
|
||||||
elseif luaentity and luaentity._knockback then
|
elseif luaentity and luaentity._knockback and die == false then
|
||||||
kb = kb + luaentity._knockback
|
kb = kb + luaentity._knockback
|
||||||
|
elseif luaentity and luaentity._knockback and die == true then
|
||||||
|
kb = kb + luaentity._knockback * 0.25
|
||||||
end
|
end
|
||||||
self._kb_turn = true
|
self._kb_turn = true
|
||||||
self._turn_to=self.object:get_yaw()-1.57
|
self._turn_to=self.object:get_yaw()-1.57
|
||||||
|
|
Loading…
Reference in New Issue