From 306db6b609417609f07f92816d124a1866e21a84 Mon Sep 17 00:00:00 2001 From: epCode Date: Tue, 25 Oct 2022 23:52:16 +0000 Subject: [PATCH] make shooting mobs calculate raycast bool for shooting with shoot_offset Basically makes skeletons accurately when to shoot and when not to. --- mods/ENTITIES/mcl_mobs/api.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/ENTITIES/mcl_mobs/api.lua b/mods/ENTITIES/mcl_mobs/api.lua index e7b0c45ea..30974fa29 100644 --- a/mods/ENTITIES/mcl_mobs/api.lua +++ b/mods/ENTITIES/mcl_mobs/api.lua @@ -3131,7 +3131,7 @@ local do_states = function(self, dtime) if 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 self.timer = 0