Removed Wulfrum Drone and Hovercraft line of sight checks

This commit is contained in:
CongratsIsTrash committed 2025-02-16 11:19:25 -05:00
1 parent d5a70366c0
commit 8d73e67c6e
2 files changed
+5 -9

No files matched your search

+2 -4
View File
@@ -108,16 +108,14 @@ namespace CalamityMod.NPCs.NormalNPCs
Player player = Main.player[NPC.target];
bool farFromPlayer = NPC.Distance(player.Center) > 960f;
bool obstacleInFrontOfPlayer = Main.remixWorld ? false : !Collision.CanHitLine(NPC.position, NPC.width, NPC.height, player.position, player.width, player.height);
if (NPC.target < 0 || NPC.target >= Main.maxPlayers || farFromPlayer || obstacleInFrontOfPlayer || player.dead || !player.active)
if (NPC.target < 0 || NPC.target >= Main.maxPlayers || farFromPlayer || player.dead || !player.active)
{
NPC.TargetClosest(false);
player = Main.player[NPC.target];
farFromPlayer = NPC.Distance(player.Center) > 960f;
obstacleInFrontOfPlayer = !Collision.CanHit(NPC.position, NPC.width, NPC.height, player.position, player.width, player.height);
// Fly away if there is no living target, or the closest target is too far away.
if (player.dead || !player.active || farFromPlayer || obstacleInFrontOfPlayer)
if (player.dead || !player.active || farFromPlayer)
{
if (FlyAwayTimer > 420)
{
+3 -5
View File
@@ -132,16 +132,14 @@ namespace CalamityMod.NPCs.NormalNPCs
Player player = Main.player[NPC.target];
bool farFromPlayer = NPC.Distance(player.Center) > 960f;
bool obstacleInFrontOfPlayer = Main.remixWorld ? false : !Collision.CanHitLine(NPC.position, NPC.width, NPC.height, player.position, player.width, player.height);
if (NPC.target < 0 || NPC.target >= 255 || farFromPlayer || obstacleInFrontOfPlayer || player.dead || !player.active)
if (NPC.target < 0 || NPC.target >= 255 || farFromPlayer|| player.dead || !player.active)
{
NPC.TargetClosest(false);
player = Main.player[NPC.target];
farFromPlayer = NPC.Distance(player.Center) > 960f;
obstacleInFrontOfPlayer = !Collision.CanHit(NPC.position, NPC.width, NPC.height, player.position, player.width, player.height);
// Fly away if there is no living target, or the closest target is too far away... unless its Gfb
if (player.dead || !player.active || farFromPlayer || obstacleInFrontOfPlayer)
// Fly away if there is no living target, or the closest target is too far away.
if (player.dead || !player.active || farFromPlayer)
{
if (FlyAwayTimer > 420)
{