From 4e698731f4c086fc2f3fdca180fcaa3f28729fdf Mon Sep 17 00:00:00 2001 From: Dominic Date: Thu, 11 Nov 2021 19:26:56 -0600 Subject: [PATCH] Boss UI bar index check for splitting worms --- UI/BossHealthBarManager.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UI/BossHealthBarManager.cs b/UI/BossHealthBarManager.cs index 7a7d896b55..e11345c23b 100644 --- a/UI/BossHealthBarManager.cs +++ b/UI/BossHealthBarManager.cs @@ -300,7 +300,7 @@ namespace CalamityMod.UI // What this is doing is checking if the next segment agrees with the fact that the previous segment is what it is attaching to. // If it doesn't, that means that we have reached the end of the worm. int failsafeCounter = 0; - while (Main.npc[(int)currentSegment.ai[0]].ai[1] == currentSegment.whoAmI) + while (Main.npc.IndexInRange((int)currentSegment.ai[0]) && Main.npc[(int)currentSegment.ai[0]].ai[1] == currentSegment.whoAmI) { // If a segment is not active for some reason, don't go any further. if (!currentSegment.active)