From e44d93f76b4e51cf71ee4a6abdc5bc0e187abb5b Mon Sep 17 00:00:00 2001
From: Lachlan <lachlanwright17@gmail.com>
Date: Sat, 4 Jul 2020 04:30:57 +0800
Subject: [PATCH] Fix skiddust positional scaling

---
 src/p_user.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/src/p_user.c b/src/p_user.c
index f973a7726..84fbd2e81 100644
--- a/src/p_user.c
+++ b/src/p_user.c
@@ -7776,11 +7776,14 @@ void P_SpawnSkidDust(player_t *player, fixed_t radius, boolean sound)
 	mobj_t *mo = player->mo;
 	mobj_t *particle;
 
-	radius >>= FRACBITS;
-	if (radius)
-		particle = P_SpawnMobjFromMobj(mo, P_RandomRange(-radius, radius) << FRACBITS, P_RandomRange(-radius, radius) << FRACBITS, 0, MT_SPINDUST);
-	else
-		particle = P_SpawnMobjFromMobj(mo, 0, 0, 0, MT_SPINDUST);
+	particle = P_SpawnMobjFromMobj(mo, 0, 0, 0, MT_SPINDUST);
+	if (radius >>= FRACBITS)
+	{
+		P_UnsetThingPosition(particle);
+		particle->x += P_RandomRange(-radius, radius) << FRACBITS;
+		particle->y += P_RandomRange(-radius, radius) << FRACBITS;
+		P_SetThingPosition(particle);
+	}
 	particle->tics = 10;
 
 	particle->destscale = (2*mo->scale)/3;
-- 
GitLab