From b141d7e88f91b276dbd858129abe5d1380b41679 Mon Sep 17 00:00:00 2001 From: mountaindrew10 Date: Sun, 26 Mar 2023 10:52:38 -0500 Subject: [PATCH] Fix for the previous commit lol --- NPCs/VanillaNPCOverrides/Bosses/QueenBeeAI.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/NPCs/VanillaNPCOverrides/Bosses/QueenBeeAI.cs b/NPCs/VanillaNPCOverrides/Bosses/QueenBeeAI.cs index 287249acfc..08d1dc9238 100644 --- a/NPCs/VanillaNPCOverrides/Bosses/QueenBeeAI.cs +++ b/NPCs/VanillaNPCOverrides/Bosses/QueenBeeAI.cs @@ -17,6 +17,14 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses { CalamityGlobalNPC calamityGlobalNPC = npc.Calamity(); + // Get a target + if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) + npc.TargetClosest(); + + // Despawn safety, make sure to target another player if the current player target is too far away + if (Vector2.Distance(Main.player[npc.target].Center, npc.Center) > CalamityGlobalNPC.CatchUpDistance200Tiles) + npc.TargetClosest(); + bool bossRush = BossRushEvent.BossRushActive; bool death = CalamityWorld.death || bossRush; @@ -58,14 +66,6 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses bool phase4 = lifeRatio < 0.25f; bool phase5 = lifeRatio < 0.1f; - // Get a target - if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) - npc.TargetClosest(); - - // Despawn safety, make sure to target another player if the current player target is too far away - if (Vector2.Distance(Main.player[npc.target].Center, npc.Center) > CalamityGlobalNPC.CatchUpDistance200Tiles) - npc.TargetClosest(); - // Despawn float num616 = Vector2.Distance(npc.Center, Main.player[npc.target].Center); if (npc.ai[0] != 5f)