From 1d39e1edc11f89590328bf66bea6ac02c23d09a3 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 30 Nov 2022 09:57:27 +0100 Subject: [PATCH] - fixed bouncing of freezer's projectile. --- source/games/duke/src/actors.cpp | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/source/games/duke/src/actors.cpp b/source/games/duke/src/actors.cpp index 789a81865..f191b6578 100644 --- a/source/games/duke/src/actors.cpp +++ b/source/games/duke/src/actors.cpp @@ -615,21 +615,16 @@ void bounce(DDukeActor* actor) double k; if (actor->spr.pos.Z < (actor->floorz + actor->ceilingz) * 0.5) - k = sectp->ceilingheinum / 16.; + k = sectp->ceilingheinum; else - k = sectp->floorheinum / 16.; + k = sectp->floorheinum; - DVector3 davec(daang.Sin() * k, -daang.Cos() * k, 16); + DVector3 davec(daang.Sin() * k, -daang.Cos() * k, 4096); double dot = vect.dot(davec); double l = davec.LengthSquared(); - const double scale = 1; // still need to figure out. - if ((abs(dot) * scale) < l) - { - k = k * l / 8.; // Guessed by '<< (17-14)' - vect -= davec * k; - } + vect -= davec * (2 * dot / l); actor->vel.Z = vect.Z; actor->vel.X = vect.XY().Length();