Removed Wulfrum Drone and Hovercraft line of sight checks
This commit is contained in:
1 parent
d5a70366c0
commit
8d73e67c6e
2 files changed
+5
-9
No files matched your search
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user