From 3d34e1ee17d6e6c9b10a5bc6632bc4f667387e87 Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Tue, 4 Feb 2020 22:36:53 -0500 Subject: [PATCH] I will obsess over this at a later date --- Projectiles/Typeless/DirectStrike.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Projectiles/Typeless/DirectStrike.cs b/Projectiles/Typeless/DirectStrike.cs index a5314a10fd..1593c78a4d 100644 --- a/Projectiles/Typeless/DirectStrike.cs +++ b/Projectiles/Typeless/DirectStrike.cs @@ -21,12 +21,13 @@ namespace CalamityMod.Projectiles.Typeless projectile.timeLeft = 2; } - // Can only strike the given NPC slot (assuming it's a valid identifier) + // If the AI parameter isn't a valid NPC slot, it can hit anything. Otherwise it can only hit one NPC. + // TODO -- this might actually not work in multiplayer if the DirectStrike gets synced... public override bool? CanHitNPC(NPC target) { - if (projectile.ai[0] < 0f || projectile.ai[0] > 199f) + if (projectile.ai[0] < 0f || projectile.ai[0] > 199f || projectile.ai[0] == target.whoAmI) return null; - return (projectile.ai[0] == target.whoAmI) ? null : (bool?)false; + return (bool?)false; } } }