From d7c76e33d8692a2ee32ed3ee6a2fc7dc3870e398 Mon Sep 17 00:00:00 2001 From: the-real-herowl Date: Tue, 26 Sep 2023 03:06:50 +0200 Subject: [PATCH] Tiny adjustments - wither initial explosion radius moved from a magic value into a local variable - wither initial explosion radius reduced - wither attack_exception improved to better handle unlikely edge cases --- mods/ENTITIES/mobs_mc/wither.lua | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/mods/ENTITIES/mobs_mc/wither.lua b/mods/ENTITIES/mobs_mc/wither.lua index 8a87c92ac..2c073452a 100644 --- a/mods/ENTITIES/mobs_mc/wither.lua +++ b/mods/ENTITIES/mobs_mc/wither.lua @@ -9,6 +9,8 @@ local follow_spawner = minetest.settings:get_bool("wither_follow_spawner") == tr local w_strafes = minetest.settings:get_bool("wither_strafes") ~= false local anti_troll = minetest.settings:get_bool("wither_anti_troll_measures") ~= false +local WITHER_INIT_BOOM = 7 + local function atan(x) if not x or x ~= x then return 0 @@ -115,8 +117,8 @@ mcl_mobs.register_mob("mobs_mc:wither", { extra_hostile = true, attack_exception = function(p) local ent = p:get_luaentity() - if not ent then return false end - if not ent.is_mob or ent.harmed_by_heal or string.find(ent.name, "ghast") then return true + if p:is_player() then return false end + if not ent or not ent.is_mob or ent.harmed_by_heal or string.find(ent.name, "ghast") then return true else return false end end, @@ -145,7 +147,7 @@ mcl_mobs.register_mob("mobs_mc:wither", { if self._spawning <= 0 then if mobs_griefing and not minetest.is_protected(pos, "") then - mcl_explosions.explode(pos, 10, { drop_chance = 1.0 }, self.object) + mcl_explosions.explode(pos, WITHER_INIT_BOOM, { drop_chance = 1.0 }, self.object) else mcl_mobs.mob_class.safe_boom(self, pos, 10) end