From 5b93ff9ea46cff9903934cf2d7bbfc30d8d584fa Mon Sep 17 00:00:00 2001 From: Storm2103 Date: Tue, 8 Aug 2023 18:53:38 -0600 Subject: [PATCH] Adding a check for the "Index 0" or "None" NPC to prevent issues. Toasty had an issue when using Gael's and when trying to give Infernum Weaver an HP bar and dmed it to me, he ended up figuring out what caused both and it was that Tml fuckup detailed here: https://discord.com/channels/103110554649894912/445276626352209920/1125094957829607554 Idk why no one has gotten an error with Gael's yet; is the weapon that obscure or its just Infernum which is a catalyst for it? Is this the memory leak? Probably not. --- CalPlayer/CalamityPlayerMiscEffects.cs | 2 +- UI/BossHealthBarManager.cs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index cb88248316..4e65df3a16 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -372,7 +372,7 @@ namespace CalamityMod.CalPlayer for (int i = 0; i < Main.maxNPCs; ++i) { NPC npc = Main.npc[i]; - if (npc is null || !npc.IsAnEnemy() || !npc.Calamity().ProvidesProximityRage) + if (npc is null || npc.type == 0 || !npc.IsAnEnemy() || !npc.Calamity().ProvidesProximityRage) continue; // Take the longer of the two directions for the NPC's hitbox to be generous. diff --git a/UI/BossHealthBarManager.cs b/UI/BossHealthBarManager.cs index 82f4d3e09b..6c8057c280 100644 --- a/UI/BossHealthBarManager.cs +++ b/UI/BossHealthBarManager.cs @@ -180,6 +180,7 @@ namespace CalamityMod.UI { BossExclusionList = new List { + NPCID.None, NPCID.MoonLordFreeEye, NPCID.MoonLordHead, NPCID.MoonLordHand,