diff --git a/NPCs/CalClone/Cataclysm.cs b/NPCs/CalClone/Cataclysm.cs index 4df01df04a..9741502b5a 100644 --- a/NPCs/CalClone/Cataclysm.cs +++ b/NPCs/CalClone/Cataclysm.cs @@ -155,10 +155,7 @@ namespace CalamityMod.NPCs.CalClone return false; } - public override bool CheckActive() - { - return NPC.Calamity().newAI[0] == 1f; - } + public override bool CheckActive() => false; public override void OnKill() { diff --git a/NPCs/CalClone/Catastrophe.cs b/NPCs/CalClone/Catastrophe.cs index 42976f6ffb..2463f4e5fd 100644 --- a/NPCs/CalClone/Catastrophe.cs +++ b/NPCs/CalClone/Catastrophe.cs @@ -155,10 +155,7 @@ namespace CalamityMod.NPCs.CalClone return false; } - public override bool CheckActive() - { - return NPC.Calamity().newAI[0] == 1f; - } + public override bool CheckActive() => false; public override void OnKill() { diff --git a/NPCs/CalamityAI.cs b/NPCs/CalamityAI.cs index f7ef82c66e..28e87a7fb0 100644 --- a/NPCs/CalamityAI.cs +++ b/NPCs/CalamityAI.cs @@ -1960,6 +1960,14 @@ namespace CalamityMod.NPCs { CalamityGlobalNPC calamityGlobalNPC = npc.Calamity(); + if (CalamityGlobalNPC.calamitas < 0 || !Main.npc[CalamityGlobalNPC.calamitas].active) + { + if (Main.netMode != NetmodeID.MultiplayerClient) + npc.StrikeInstantKill(); + + return; + } + // Percent life remaining float lifeRatio = npc.life / (float)npc.lifeMax; @@ -2023,18 +2031,11 @@ namespace CalamityMod.NPCs if (npc.rotation > num842 - num843 && npc.rotation < num842 + num843) npc.rotation = num842; - bool calCloneActive = false; - if (CalamityGlobalNPC.calamitas != -1) - { - if (Main.npc[CalamityGlobalNPC.calamitas].active) - calCloneActive = true; - } - - if (!player.active || player.dead || !calCloneActive) + if (!player.active || player.dead) { npc.TargetClosest(false); player = Main.player[npc.target]; - if (!player.active || player.dead || !calCloneActive) + if (!player.active || player.dead) { if (npc.velocity.Y > 3f) npc.velocity.Y = 3f; @@ -2042,8 +2043,6 @@ namespace CalamityMod.NPCs if (npc.velocity.Y < -12f) npc.velocity.Y = -12f; - calamityGlobalNPC.newAI[0] = 1f; - if (npc.timeLeft > 60) npc.timeLeft = 60; @@ -2054,11 +2053,10 @@ namespace CalamityMod.NPCs npc.ai[3] = 0f; npc.netUpdate = true; } + return; } } - else - calamityGlobalNPC.newAI[0] = 0f; if (npc.ai[1] == 0f) { @@ -2269,6 +2267,14 @@ namespace CalamityMod.NPCs { CalamityGlobalNPC calamityGlobalNPC = npc.Calamity(); + if (CalamityGlobalNPC.calamitas < 0 || !Main.npc[CalamityGlobalNPC.calamitas].active) + { + if (Main.netMode != NetmodeID.MultiplayerClient) + npc.StrikeInstantKill(); + + return; + } + // Percent life remaining float lifeRatio = npc.life / (float)npc.lifeMax; @@ -2332,18 +2338,11 @@ namespace CalamityMod.NPCs if (npc.rotation > num842 - num843 && npc.rotation < num842 + num843) npc.rotation = num842; - bool calCloneActive = false; - if (CalamityGlobalNPC.calamitas != -1) - { - if (Main.npc[CalamityGlobalNPC.calamitas].active) - calCloneActive = true; - } - - if (!player.active || player.dead || !calCloneActive) + if (!player.active || player.dead) { npc.TargetClosest(false); player = Main.player[npc.target]; - if (!player.active || player.dead || !calCloneActive) + if (!player.active || player.dead) { if (npc.velocity.Y > 3f) npc.velocity.Y = 3f; @@ -2351,8 +2350,6 @@ namespace CalamityMod.NPCs if (npc.velocity.Y < -12f) npc.velocity.Y = -12f; - calamityGlobalNPC.newAI[0] = 1f; - if (npc.timeLeft > 60) npc.timeLeft = 60; @@ -2363,11 +2360,10 @@ namespace CalamityMod.NPCs npc.ai[3] = 0f; npc.netUpdate = true; } + return; } } - else - calamityGlobalNPC.newAI[0] = 0f; if (npc.ai[1] == 0f) {