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.
This commit is contained in:
Storm2103 committed 2023-08-08 18:53:38 -06:00
1 parent 3ef36036ef
commit 5b93ff9ea4
2 files changed
+2 -1

No files matched your search

+1 -1
View File
@@ -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.
+1
View File
@@ -180,6 +180,7 @@ namespace CalamityMod.UI
{
BossExclusionList = new List<int>
{
NPCID.None,
NPCID.MoonLordFreeEye,
NPCID.MoonLordHead,
NPCID.MoonLordHand,