From cdffaf4abc960dd6982b5d41298a99572b8fedc5 Mon Sep 17 00:00:00 2001 From: Andrew Marheine Date: Fri, 20 Nov 2020 14:03:33 -0600 Subject: [PATCH] 1 - Aquatic Scourge despawns if 500 tiles away, despawns if 250 tiles away if it's passive. --- NPCs/CalamityAI.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/NPCs/CalamityAI.cs b/NPCs/CalamityAI.cs index 113bac28b9..c90f772c39 100644 --- a/NPCs/CalamityAI.cs +++ b/NPCs/CalamityAI.cs @@ -333,7 +333,8 @@ namespace CalamityMod.NPCs } } - if (player.dead) + float maxDistance = calamityGlobalNPC.newAI[0] == 1f ? 8000f : 4000f; + if (player.dead || Vector2.Distance(npc.Center, player.Center) > maxDistance) { calamityGlobalNPC.newAI[1] = 1f; npc.TargetClosest(false);