From 76f5c099edf69e186e7701a50d29c868bd85ba49 Mon Sep 17 00:00:00 2001 From: Joonas Rikkonen Date: Tue, 13 Feb 2018 13:50:41 +0200 Subject: [PATCH] Particles that rotate towards the movement direction use sub-relative movement when inside the sub (weld/cut particles don't face the movement direction of the submarine anymore). --- Barotrauma/BarotraumaClient/Source/Particles/Particle.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Barotrauma/BarotraumaClient/Source/Particles/Particle.cs b/Barotrauma/BarotraumaClient/Source/Particles/Particle.cs index 3a18e142c..04f14f075 100644 --- a/Barotrauma/BarotraumaClient/Source/Particles/Particle.cs +++ b/Barotrauma/BarotraumaClient/Source/Particles/Particle.cs @@ -168,7 +168,12 @@ namespace Barotrauma.Particles { if (velocityChange != Vector2.Zero || angularVelocity != 0.0f) { - rotation = MathUtils.VectorToAngle(new Vector2(velocity.X, -velocity.Y)); + Vector2 relativeVel = velocity; + if (currentHull?.Submarine != null) + { + relativeVel -= ConvertUnits.ToDisplayUnits(currentHull.Submarine.Velocity); + } + rotation = MathUtils.VectorToAngle(new Vector2(relativeVel.X, -relativeVel.Y)); } } else