From 8feecf2492930b42cf17013851626fda67814c01 Mon Sep 17 00:00:00 2001 From: teknomunk Date: Sun, 26 May 2024 15:21:43 +0000 Subject: [PATCH] Fix crashes with raids and bad omen effect (#4326) Reviewed-on: https://git.minetest.land/VoxeLibre/VoxeLibre/pulls/4326 Reviewed-by: the-real-herowl Co-authored-by: teknomunk Co-committed-by: teknomunk --- mods/ENVIRONMENT/mcl_raids/init.lua | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/mods/ENVIRONMENT/mcl_raids/init.lua b/mods/ENVIRONMENT/mcl_raids/init.lua index 1b762b0e9..d0c10eb20 100644 --- a/mods/ENVIRONMENT/mcl_raids/init.lua +++ b/mods/ENVIRONMENT/mcl_raids/init.lua @@ -105,8 +105,6 @@ function mcl_raids.promote_to_raidcaptain(c) -- object if cmi_cause and cmi_cause.type == "punch" and cmi_cause.puncher:is_player() then awards.unlock(cmi_cause.puncher:get_player_name(), "mcl:voluntary_exile") local lv = mcl_potions.get_effect_level(cmi_cause.puncher, "bad_omen") - if not lv then lv = 0 - else lv = lv.factor end lv = math.max(5,lv + 1) mcl_potions.give_effect_by_level("bad_omen", cmi_cause.puncher, lv, 6000) end @@ -311,7 +309,7 @@ mcl_events.register_event("raid",{ self.health_max = 1 self.health = 0 local lv = mcl_potions.get_effect_level(minetest.get_player_by_name(self.player), "bad_omen") - if lv and lv.factor and lv.factor > 1 then self.max_stage = 6 end + if lv > 1 then self.max_stage = 6 end end, cond_progress = function(self) if not is_player_near(self) then return false end