From 19a58ddeb0e3277c8bf58478247b78e9b76af4bd Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 21 Jan 2023 14:33:42 +0100 Subject: [PATCH] - Blood: fixed velocity for ejected shell casings. --- source/games/blood/src/fx.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/source/games/blood/src/fx.cpp b/source/games/blood/src/fx.cpp index fdbed1e0d..7fa226f23 100644 --- a/source/games/blood/src/fx.cpp +++ b/source/games/blood/src/fx.cpp @@ -329,7 +329,8 @@ void fxSpawnEjectingBrass(DBloodActor* actor, double z, double dist, int rdist) { if (!VanillaMode()) pBrass->spr.Angles.Yaw = RandomAngle(); - double nDist = rdist / 30. + Random2F(((rdist / 4) << 18) / 120, 4); + int iDist = (rdist << 18) / 120 + Random2(((rdist / 4) << 18) / 120); + double nDist = iDist / 65536.; DAngle nAngle = actor->spr.Angles.Yaw + Random2A(56) + DAngle90; pBrass->vel.XY() = nAngle.ToVector() * nDist; pBrass->vel.Z = actor->vel.Z - 2 - Random2(40) / 30.; @@ -351,7 +352,8 @@ void fxSpawnEjectingShell(DBloodActor* actor, double z, double dist, int rdist) { if (!VanillaMode()) pShell->spr.Angles.Yaw = RandomAngle(); - double nDist = rdist / 30. + Random2F(((rdist / 4) << 18) / 120, 4); + int iDist = (rdist << 18) / 120 + Random2(((rdist / 4) << 18) / 120); + double nDist = iDist / 65536.; DAngle nAngle = actor->spr.Angles.Yaw + Random2A(56) + DAngle90; pShell->vel.XY() = nAngle.ToVector() * nDist; pShell->vel.Z = actor->vel.Z - 2 - Random2(28) / 30.;