[mcl_mobs/api] Fix critical attempt to index local pos2 (a nil value)

This commit is contained in:
kay27 2021-06-21 02:44:55 +04:00
parent f30a2ab6bc
commit ed8d79395d
1 changed files with 3 additions and 0 deletions

View File

@ -125,6 +125,9 @@ mobs.set_yaw_while_attacking = function(self)
pos1.y = 0 pos1.y = 0
local pos2 = self.attacking:get_pos() local pos2 = self.attacking:get_pos()
if not pos2 then
return
end
pos2.y = 0 pos2.y = 0
local new_direction = vector_direction(pos1,pos2) local new_direction = vector_direction(pos1,pos2)