From 4c567b5cabe7752b37b014faacefc284e973d3a1 Mon Sep 17 00:00:00 2001 From: mountaindrew10 Date: Sat, 11 Jun 2022 14:12:56 -0500 Subject: [PATCH] 1 - Fixed WoF despawn issue finally. --- NPCs/VanillaNPCOverrides/Bosses/WallOfFleshAI.cs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/NPCs/VanillaNPCOverrides/Bosses/WallOfFleshAI.cs b/NPCs/VanillaNPCOverrides/Bosses/WallOfFleshAI.cs index 9d06723144..c69eed8792 100644 --- a/NPCs/VanillaNPCOverrides/Bosses/WallOfFleshAI.cs +++ b/NPCs/VanillaNPCOverrides/Bosses/WallOfFleshAI.cs @@ -23,10 +23,6 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses if (npc.position.X < 160f || npc.position.X > ((Main.maxTilesX - 10) * 16)) npc.active = false; - // Get a target - if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) - npc.TargetClosest(); - // Set Wall of Flesh variables if (npc.localAI[0] == 0f) { @@ -106,7 +102,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses int num334 = (int)((npc.position.Y + (npc.height / 2)) / 16f); int num335 = 0; int num336 = num334 + 7; - while (num335 < 15 && num336 > Main.maxTilesY - 200) + while (num335 < 15 && num336 > Main.UnderworldLayer) { num336++; int num; @@ -249,7 +245,6 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses // Return to normal if very close to target if (distanceFromTarget < distanceBeforeSlowingDown) { - npc.TargetClosest(); calamityGlobalNPC.newAI[0] = 0f; calamityGlobalNPC.newAI[1] = 0f; npc.ai[3] = 0f; @@ -414,7 +409,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses } if (num348 >= 0) { - int num353 = NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.position.X, (int)num339, NPCID.TheHungry, npc.whoAmI, 0f, 0f, 0f, 0f, 255); + int num353 = NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.position.X, (int)num339, NPCID.TheHungry, npc.whoAmI); Main.npc[num353].ai[0] = num348 * 0.1f - 0.05f; } }