From f3f71f1b6c618698868ed55fe49ba84698cd8ac0 Mon Sep 17 00:00:00 2001 From: sunny-raindrops Date: Wed, 27 May 2026 15:50:20 -0700 Subject: [PATCH] Lab Turrets no longer target invisible players --- TileEntities/TEHostileFireTurret.cs | 6 +++--- TileEntities/TEHostileIceTurret.cs | 6 +++--- TileEntities/TEHostileLabTurret.cs | 6 +++--- TileEntities/TEHostileLaserTurret.cs | 6 +++--- TileEntities/TEHostileOnyxTurret.cs | 6 +++--- TileEntities/TEHostilePlagueTurret.cs | 6 +++--- TileEntities/TEHostileWaterTurret.cs | 6 +++--- 7 files changed, 21 insertions(+), 21 deletions(-) diff --git a/TileEntities/TEHostileFireTurret.cs b/TileEntities/TEHostileFireTurret.cs index 33ae21e7c2..18813caf5c 100644 --- a/TileEntities/TEHostileFireTurret.cs +++ b/TileEntities/TEHostileFireTurret.cs @@ -66,8 +66,8 @@ namespace CalamityMod.TileEntities { Player p = Main.player[PlayerTargetIndex]; - // If they don't exist, or are dead, then unmark them as a target and search for a new one. - if (!p.active || p.dead) + // If they don't exist, are dead, or are using an invis pot then unmark them as a target and search for a new one. + if (!p.active || p.dead || p.invis) indexToSet = -1; else { @@ -87,7 +87,7 @@ namespace CalamityMod.TileEntities foreach (Player p in Main.ActivePlayers) { - if (p.dead) + if (p.dead || p.invis) continue; float distSQ = p.DistanceSQ(targetingCenter); diff --git a/TileEntities/TEHostileIceTurret.cs b/TileEntities/TEHostileIceTurret.cs index d1ebcd8a6d..64fbd80707 100644 --- a/TileEntities/TEHostileIceTurret.cs +++ b/TileEntities/TEHostileIceTurret.cs @@ -66,8 +66,8 @@ namespace CalamityMod.TileEntities { Player p = Main.player[PlayerTargetIndex]; - // If they don't exist, or are dead, then unmark them as a target and search for a new one. - if (!p.active || p.dead) + // If they don't exist, are dead, or are using an invis pot then unmark them as a target and search for a new one. + if (!p.active || p.dead || p.invis) indexToSet = -1; else { @@ -87,7 +87,7 @@ namespace CalamityMod.TileEntities foreach (Player p in Main.ActivePlayers) { - if (p.dead) + if (p.dead || p.invis) continue; float distSQ = p.DistanceSQ(targetingCenter); diff --git a/TileEntities/TEHostileLabTurret.cs b/TileEntities/TEHostileLabTurret.cs index d74b9474a4..b1e8dbd9f4 100644 --- a/TileEntities/TEHostileLabTurret.cs +++ b/TileEntities/TEHostileLabTurret.cs @@ -66,8 +66,8 @@ namespace CalamityMod.TileEntities { Player p = Main.player[PlayerTargetIndex]; - // If they don't exist, or are dead, then unmark them as a target and search for a new one. - if (!p.active || p.dead) + // If they don't exist, are dead, or are using an invis pot then unmark them as a target and search for a new one. + if (!p.active || p.dead || p.invis) indexToSet = -1; else { @@ -87,7 +87,7 @@ namespace CalamityMod.TileEntities foreach (Player p in Main.ActivePlayers) { - if (p.dead) + if (p.dead || p.invis) continue; float distSQ = p.DistanceSQ(targetingCenter); diff --git a/TileEntities/TEHostileLaserTurret.cs b/TileEntities/TEHostileLaserTurret.cs index f34b471781..732524ac75 100644 --- a/TileEntities/TEHostileLaserTurret.cs +++ b/TileEntities/TEHostileLaserTurret.cs @@ -66,8 +66,8 @@ namespace CalamityMod.TileEntities { Player p = Main.player[PlayerTargetIndex]; - // If they don't exist, or are dead, then unmark them as a target and search for a new one. - if (!p.active || p.dead) + // If they don't exist, are dead, or are using an invis pot then unmark them as a target and search for a new one. + if (!p.active || p.dead || p.invis) indexToSet = -1; else { @@ -87,7 +87,7 @@ namespace CalamityMod.TileEntities foreach (Player p in Main.ActivePlayers) { - if (p.dead) + if (p.dead || p.invis) continue; float distSQ = p.DistanceSQ(targetingCenter); diff --git a/TileEntities/TEHostileOnyxTurret.cs b/TileEntities/TEHostileOnyxTurret.cs index 78a7fd87e9..a3467c083d 100644 --- a/TileEntities/TEHostileOnyxTurret.cs +++ b/TileEntities/TEHostileOnyxTurret.cs @@ -66,8 +66,8 @@ namespace CalamityMod.TileEntities { Player p = Main.player[PlayerTargetIndex]; - // If they don't exist, or are dead, then unmark them as a target and search for a new one. - if (!p.active || p.dead) + // If they don't exist, are dead, or are using an invis pot then unmark them as a target and search for a new one. + if (!p.active || p.dead || p.invis) indexToSet = -1; else { @@ -87,7 +87,7 @@ namespace CalamityMod.TileEntities foreach (Player p in Main.ActivePlayers) { - if (p.dead) + if (p.dead || p.invis) continue; float distSQ = p.DistanceSQ(targetingCenter); diff --git a/TileEntities/TEHostilePlagueTurret.cs b/TileEntities/TEHostilePlagueTurret.cs index 05cca39c47..0a74b7f4df 100644 --- a/TileEntities/TEHostilePlagueTurret.cs +++ b/TileEntities/TEHostilePlagueTurret.cs @@ -66,8 +66,8 @@ namespace CalamityMod.TileEntities { Player p = Main.player[PlayerTargetIndex]; - // If they don't exist, or are dead, then unmark them as a target and search for a new one. - if (!p.active || p.dead) + // If they don't exist, are dead, or are using an invis pot then unmark them as a target and search for a new one. + if (!p.active || p.dead || p.invis) indexToSet = -1; else { @@ -87,7 +87,7 @@ namespace CalamityMod.TileEntities foreach (Player p in Main.ActivePlayers) { - if (p.dead) + if (p.dead || p.invis) continue; float distSQ = p.DistanceSQ(targetingCenter); diff --git a/TileEntities/TEHostileWaterTurret.cs b/TileEntities/TEHostileWaterTurret.cs index 2b2f0a8923..ba768e59ff 100644 --- a/TileEntities/TEHostileWaterTurret.cs +++ b/TileEntities/TEHostileWaterTurret.cs @@ -66,8 +66,8 @@ namespace CalamityMod.TileEntities { Player p = Main.player[PlayerTargetIndex]; - // If they don't exist, or are dead, then unmark them as a target and search for a new one. - if (!p.active || p.dead) + // If they don't exist, are dead, or are using an invis pot then unmark them as a target and search for a new one. + if (!p.active || p.dead || p.invis) indexToSet = -1; else { @@ -87,7 +87,7 @@ namespace CalamityMod.TileEntities foreach (Player p in Main.ActivePlayers) { - if (p.dead) + if (p.dead || p.invis) continue; float distSQ = p.DistanceSQ(targetingCenter);