mirror of
https://github.com/ZDoom/Raze.git
synced 2025-02-20 18:42:26 +00:00
- Exhumed: Split out player death pitch code.
This commit is contained in:
parent
8812831c73
commit
e256ac06e9
1 changed files with 45 additions and 35 deletions
|
@ -1096,6 +1096,50 @@ static void doPlayerPitch(Player* const pPlayer)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
static void doPlayerDeathPitch(Player* const pPlayer)
|
||||
{
|
||||
const auto pPlayerActor = pPlayer->pActor;
|
||||
pPlayer->nThrust.Zero();
|
||||
|
||||
if (pPlayerActor->viewzoffset >= -11)
|
||||
{
|
||||
pPlayerActor->viewzoffset = -11;
|
||||
pPlayer->dVertPan = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (pPlayerActor->spr.Angles.Pitch.Sgn() > 0)
|
||||
{
|
||||
pPlayerActor->spr.Angles.Pitch = nullAngle;
|
||||
pPlayerActor->viewzoffset -= pPlayer->dVertPan;
|
||||
}
|
||||
else
|
||||
{
|
||||
pPlayerActor->spr.Angles.Pitch -= maphoriz(pPlayer->dVertPan);
|
||||
|
||||
if (pPlayerActor->spr.Angles.Pitch.Degrees() <= -38)
|
||||
{
|
||||
pPlayerActor->spr.Angles.Pitch = DAngle::fromDeg(-37.72);
|
||||
}
|
||||
else if (pPlayerActor->spr.Angles.Pitch.Sgn() >= 0)
|
||||
{
|
||||
if (!(pPlayerActor->sector()->Flag & kSectUnderwater))
|
||||
{
|
||||
SetNewWeapon(pPlayer->nPlayer, pPlayer->nDeathType + 8);
|
||||
}
|
||||
}
|
||||
|
||||
pPlayer->dVertPan--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
// this function is pure spaghetti madness... :(
|
||||
|
@ -1635,41 +1679,7 @@ sectdone:
|
|||
}
|
||||
|
||||
if (!pPlayer->nHealth)
|
||||
{
|
||||
pPlayer->nThrust.Zero();
|
||||
|
||||
if (pPlayerActor->viewzoffset >= -11)
|
||||
{
|
||||
pPlayerActor->viewzoffset = -11;
|
||||
pPlayer->dVertPan = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (pPlayer->pActor->spr.Angles.Pitch.Sgn() > 0)
|
||||
{
|
||||
pPlayerActor->spr.Angles.Pitch = nullAngle;
|
||||
pPlayerActor->viewzoffset -= pPlayer->dVertPan;
|
||||
}
|
||||
else
|
||||
{
|
||||
pPlayer->pActor->spr.Angles.Pitch -= maphoriz(pPlayer->dVertPan);
|
||||
|
||||
if (pPlayer->pActor->spr.Angles.Pitch.Degrees() <= -38)
|
||||
{
|
||||
pPlayer->pActor->spr.Angles.Pitch = DAngle::fromDeg(-37.72);
|
||||
}
|
||||
else if (pPlayer->pActor->spr.Angles.Pitch.Sgn() >= 0)
|
||||
{
|
||||
if (!(pPlayerActor->sector()->Flag & kSectUnderwater))
|
||||
{
|
||||
SetNewWeapon(nPlayer, pPlayer->nDeathType + 8);
|
||||
}
|
||||
}
|
||||
|
||||
pPlayer->dVertPan--;
|
||||
}
|
||||
}
|
||||
}
|
||||
doPlayerDeathPitch(pPlayer);
|
||||
|
||||
// loc_1C4E1
|
||||
pDopple->spr.pos = pPlayerActor->spr.pos;
|
||||
|
|
Loading…
Reference in a new issue