From b11642c6b02f87422d01918ab46eefd60a8a8cc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=20Vald=C3=A9s?= Date: Fri, 28 Feb 2020 07:42:10 +0100 Subject: [PATCH] Fix railgun effect particle spawning --- src/renderer/cursor_renderer/cursor_vfx.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/renderer/cursor_renderer/cursor_vfx.rs b/src/renderer/cursor_renderer/cursor_vfx.rs index faebbed..f61b0df 100644 --- a/src/renderer/cursor_renderer/cursor_vfx.rs +++ b/src/renderer/cursor_renderer/cursor_vfx.rs @@ -259,7 +259,13 @@ impl CursorVfx for ParticleTrail { // Distribute particles along the travel distance, with a random offset to make it // look random - let pos = prev_p + travel * self.rng.next_f32(); + + let pos = match self.trail_mode { + TrailMode::Railgun => prev_p + travel * t, + TrailMode::PixieDust | TrailMode::Torpedo => { + prev_p + travel * self.rng.next_f32() + } + }; self.add_particle(pos, speed, t * settings.vfx_particle_lifetime); } @@ -388,4 +394,3 @@ impl RngState { v } } -