forked from VoxeLibre/VoxeLibre
Fix being able to reduce knockback while guarding when facing away from Hoglin/Zoglin
This commit is contained in:
parent
a591e655ef
commit
3c6b334df1
|
@ -70,7 +70,8 @@ local hoglin = {
|
||||||
floats = 0,
|
floats = 0,
|
||||||
custom_attack = function(self)
|
custom_attack = function(self)
|
||||||
if self.state == "attack" and self.reach > vector.distance(self.object:get_pos(), self.attack:get_pos()) then
|
if self.state == "attack" and self.reach > vector.distance(self.object:get_pos(), self.attack:get_pos()) then
|
||||||
if self.attack:is_player() and mcl_shields and mcl_shields.is_blocking and mcl_shields.is_blocking(self.attack) then
|
local shield_dot = vector.dot(self.attack:get_look_dir(), vector.subtract(self.object:get_pos(), self.attack:get_pos()))
|
||||||
|
if self.attack:is_player() and mcl_shields and mcl_shields.is_blocking and mcl_shields.is_blocking(self.attack) and shield_dot >= 0 then
|
||||||
self.attack:add_velocity({x=0,y=9.75,z=0})
|
self.attack:add_velocity({x=0,y=9.75,z=0})
|
||||||
else
|
else
|
||||||
self.attack:add_velocity({x=0,y=13,z=0})
|
self.attack:add_velocity({x=0,y=13,z=0})
|
||||||
|
|
Loading…
Reference in New Issue