- SW: Adjustments to the death height code on the back of the last commit.

This commit is contained in:
Mitchell Richters 2022-12-23 19:10:33 +11:00
parent 5f1581be9d
commit 4890f1d9dc
3 changed files with 7 additions and 20 deletions

View file

@ -798,6 +798,10 @@ static void analyzesprites(tspriteArray& tsprites, const DVector3& viewpos, doub
}
pos.Z = tsp->pos.Z + pp->si.Z + pp->getViewHeightDiff();
if ((pp->Flags & PF_DEAD) && pos.Z > pp->actor->user.loz - pp->actor->user.floor_dist)
pos.Z = pp->actor->user.loz - pp->actor->user.floor_dist;
tsp->pos = pos;
tsp->Angles.Yaw = pp->siang;
//continue;

View file

@ -1483,8 +1483,9 @@ void DoPlayerSetWadeDepth(PLAYER* pp)
//
//---------------------------------------------------------------------------
void DoPlayerHeight(PLAYER* pp, const double scale = PLAYER_NORMAL_FALL_VALUEF)
void DoPlayerHeight(PLAYER* pp)
{
constexpr double scale = 0.375;
pp->actor->viewzoffset -= pp->getViewHeightDiff() * scale;
pp->actor->spr.pos.Z -= (pp->actor->spr.pos.Z - pp->loz) * scale;
}
@ -6289,7 +6290,6 @@ void DoPlayerDeathFlip(PLAYER* pp)
}
DoPlayerDeathCheckKeys(pp);
if (pp->height == PLAYER_DEATH_HEIGHTF) DoPlayerHeight(pp, PLAYER_DEATH_FALL_VALUEF);
}
@ -6332,7 +6332,6 @@ void DoPlayerDeathDrown(PLAYER* pp)
DoPlayerDeathFollowKiller(pp);
DoPlayerDeathCheckKeys(pp);
if (pp->height == PLAYER_DEATH_HEIGHTF) DoPlayerHeight(pp, PLAYER_DEATH_FALL_VALUEF);
}
@ -6423,12 +6422,6 @@ void DoPlayerDeathCrumble(PLAYER* pp)
DoPlayerDeathCheckKeys(pp);
DoPlayerHeadDebris(pp);
if (pp->height == PLAYER_DEATH_HEIGHTF)
{
pp->loz = pp->actor->user.loz - PLAYER_DEAD_HEAD_FLOORZ_OFFSET;
DoPlayerHeight(pp, PLAYER_DEATH_FALL_VALUEF);
}
}
//---------------------------------------------------------------------------
@ -6487,12 +6480,6 @@ void DoPlayerDeathExplode(PLAYER* pp)
DoPlayerDeathCheckKeys(pp);
DoPlayerHeadDebris(pp);
if (pp->height == PLAYER_DEATH_HEIGHTF)
{
pp->loz = pp->actor->user.loz - PLAYER_DEAD_HEAD_FLOORZ_OFFSET;
DoPlayerHeight(pp, PLAYER_DEATH_FALL_VALUEF);
}
}
//---------------------------------------------------------------------------

View file

@ -112,15 +112,11 @@ constexpr double PLAYER_FALL_HEIGHTF = 28;
// dead head height - used in DeathFall
#define PLAYER_DEATH_HEIGHT (Z(16))
constexpr double PLAYER_DEATH_HEIGHTF = 16;
constexpr double PLAYER_DEAD_HEAD_FLOORZ_OFFSET = PLAYER_DEATH_HEIGHTF * 0.5;
constexpr double PLAYER_DEAD_HEAD_FLOORZ_OFFSET = 7;
constexpr double PLAYER_NINJA_XREPEAT = 0.734375;
constexpr double PLAYER_NINJA_YREPEAT = 0.515625;
// Fall rates
constexpr double PLAYER_NORMAL_FALL_VALUEF = (96. / 256.);
constexpr double PLAYER_DEATH_FALL_VALUEF = PLAYER_NORMAL_FALL_VALUEF * 0.5;
BEGIN_SW_NS
int SetVisHigh(void);