Failed flip fix

This commit is contained in:
IbanPlay authored and Cameron Ewell committed 2021-12-13 11:58:52 -05:00
1 parent fa67a1182a
commit d2360fa653
1 file changed
+2 -1
+2 -1
View File
@@ -293,8 +293,9 @@ namespace CalamityMod.Items.Weapons.Ranged
Vector2 ShiftDown = PointingTo.RotatedBy(-MathHelper.PiOver2);
//Vector2 ShiftDown = new Vector2((float)Math.Cos(projectile.rotation + BoltAngle - MathHelper.PiOver2), (float)Math.Sin(projectile.rotation + BoltAngle - MathHelper.PiOver2)); //Shift the arrow halfway down so it appears aligned. I'm also P sure theres a function to rotate a vector by an angle but i forgor
Vector2 drawPosition = Owner.Center+ PointingTo*(20f+(Shift*40)) - ShiftDown*(BoltTexture.Width/2) - Main.screenPosition;
float FlipFactor = projectile.direction == -1 ? MathHelper.Pi : 0f;
spriteBatch.Draw(BoltTexture, drawPosition, null, Transparency, projectile.rotation + BoltAngle + MathHelper.PiOver2 , BoltTexture.Size(), 1f, 0, 0);
spriteBatch.Draw(BoltTexture, drawPosition, null, Transparency, projectile.rotation + BoltAngle + MathHelper.PiOver2 + FlipFactor, BoltTexture.Size(), 1f, 0, 0);
if (i == LoadedBolts - 1 || LoadedBolts == ClockworkBow.MaxBolts) //Don't forget to exit the shader region
spriteBatch.ExitShaderRegion();