From 188fa06a9969734a2f5c56bdd20797812e39b3da Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Fri, 6 Oct 2023 14:32:27 -0400 Subject: [PATCH] fix miracle blight crashing vanilla bosses whoops --- NPCs/CalamityGlobalNPC.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 7a14944638..876fa73a7b 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -5647,7 +5647,8 @@ namespace CalamityMod.NPCs VulnerabilityHexFireDrawer = null; // Miracle Blight will not attempt to use its shader on bosses from other mods. It still works on vanilla bosses. - bool otherModBoss = npc.IsABoss() && npc.ModNPC.Mod is not null && npc.ModNPC.Mod != CalamityMod.Instance; + Mod sourceMod = npc.ModNPC?.Mod ?? null; + bool otherModBoss = npc.IsABoss() && sourceMod != CalamityMod.Instance; // Setting the NPC immune to Miracle Blight also makes the shader immediately disappear. bool useMiracleBlightShader = !npc.buffImmune[BuffType()] && !otherModBoss; if (useMiracleBlightShader && npc.Calamity().miracleBlight > 0)