From 027bb4de701b67ad473d2d55df920a612ce1facc Mon Sep 17 00:00:00 2001 From: Memes <114233643+Mr-Memes@users.noreply.github.com> Date: Sun, 5 Mar 2023 15:34:55 +0100 Subject: [PATCH] Fixed the minion's movement. 1 - Uses .Normalize() instead of .SafeNormalize() because the minion will literally won't work with it. --- Projectiles/Summon/SandnadoMinion.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Projectiles/Summon/SandnadoMinion.cs b/Projectiles/Summon/SandnadoMinion.cs index 6615be954c..20c06308af 100644 --- a/Projectiles/Summon/SandnadoMinion.cs +++ b/Projectiles/Summon/SandnadoMinion.cs @@ -122,22 +122,22 @@ namespace CalamityMod.Projectiles.Summon public void MoveToTarget(NPC target) { - Vector2 vectorToTarget = target.Center - Projectile.Center; - float targetDist = vectorToTarget.Length(); - vectorToTarget.SafeNormalize(Vector2.UnitY); + Vector2 vecToTarget = target.Center - Projectile.Center; + float targetDist = vecToTarget.Length(); + vecToTarget.Normalize(); //If farther than 200 pixels, move toward it if (targetDist > 200f) { float speedMult = (targetDist > 400f) ? 12f : (targetDist > 250) ? 6f : 3f; - vectorToTarget *= speedMult; - Projectile.velocity = (Projectile.velocity * 40f + vectorToTarget) / 41f; + vecToTarget *= speedMult; + Projectile.velocity = (Projectile.velocity * 40f + vecToTarget) / 41f; } //Otherwise, back it up slowly else { float speedMult = -3f; - vectorToTarget *= speedMult; - Projectile.velocity = (Projectile.velocity * 40f + vectorToTarget) / 41f; + vecToTarget *= speedMult; + Projectile.velocity = (Projectile.velocity * 40f + vecToTarget) / 41f; } }