0
0
Fork 0

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
This commit is contained in:
the-real-herowl 2023-09-26 03:06:50 +02:00 committed by the-real-herowl
parent 966712f4ff
commit d7c76e33d8
1 changed files with 5 additions and 3 deletions

View File

@ -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