make shooting mobs calculate raycast bool for shooting with shoot_offset

Basically makes skeletons accurately when to shoot and when not to.
This commit is contained in:
epCode 2022-10-25 23:52:16 +00:00
parent 65289de86e
commit 306db6b609
1 changed files with 1 additions and 1 deletions

View File

@ -3131,7 +3131,7 @@ local do_states = function(self, dtime)
if self.shoot_interval if self.shoot_interval
and self.timer > self.shoot_interval and self.timer > self.shoot_interval
and not minetest.raycast(p, self.attack:get_pos(), false, false):next() and not minetest.raycast(vector.add(p, vector.new(0,self.shoot_offset,0)), vector.add(self.attack:get_pos(), vector.new(0,1.5,0)), false, false):next()
and random(1, 100) <= 60 then and random(1, 100) <= 60 then
self.timer = 0 self.timer = 0