- Exhumed: Clean up push factor in runlist_CheckRadialDamage() for players.

* Some fudging was added due to issues that have now been properly resolved in 40265e649f.
This commit is contained in:
Mitchell Richters 2023-11-06 08:05:44 +11:00
parent 3066df54e0
commit 6f7a07dca1

View file

@ -23,8 +23,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "sound.h" #include "sound.h"
#include <assert.h> #include <assert.h>
CVARD(Bool, cl_exdamagepush, false, CVAR_ARCHIVE, "enables player damage pushback from explosions, etc.")
BEGIN_PS_NS BEGIN_PS_NS
enum enum
@ -1776,23 +1774,14 @@ int runlist_CheckRadialDamage(DExhumedActor* pActor)
{ {
if ((nPush = max((nRadialDamage * (nDamageRadius - nDist)) / nDamageRadius, 0.)) > 20) if ((nPush = max((nRadialDamage * (nDamageRadius - nDist)) / nDamageRadius, 0.)) > 20)
{ {
const auto nVel = DVector3(pos.Angle().ToVector(), -24 * (1. / 256.)) * nPush; pActor->vel += DVector3(pos.Angle().ToVector() * 0.125, -24 * (1. / 256.)) * nPush;
pActor->vel.Z += nVel.Z;
if (pActor->vel.Z < -14) if (pActor->vel.Z < -14)
pActor->vel.Z = -14; pActor->vel.Z = -14;
if (pActor->spr.statnum == 100) if (pActor->spr.statnum == 100)
{
// The player's max vel is 15.25 for reference.
pActor->vel.XY() += nVel.XY() * 0.1875 * cl_exdamagepush;
getPlayer(GetPlayerFromActor(pActor))->bJumping = true; getPlayer(GetPlayerFromActor(pActor))->bJumping = true;
} }
else
{
pActor->vel.XY() += nVel.XY() * 0.125;
}
}
} }
pActor->spr.cstat = nCStat; pActor->spr.cstat = nCStat;