mirror of
https://github.com/ZDoom/Raze.git
synced 2025-04-04 06:55:48 +00:00
- Exhumed: Split out player quake code.
This commit is contained in:
parent
04ab6f4640
commit
f7433234b2
1 changed files with 22 additions and 9 deletions
|
@ -963,6 +963,27 @@ static void doPlayerInvincibility(Player* const pPlayer)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
static void doPlayerQuake(Player* const pPlayer)
|
||||
{
|
||||
pPlayer->nQuake = -pPlayer->nQuake;
|
||||
|
||||
if (pPlayer->nQuake > 0)
|
||||
{
|
||||
pPlayer->nQuake -= 2.;
|
||||
|
||||
if (pPlayer->nQuake < 0)
|
||||
{
|
||||
pPlayer->nQuake = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
// this function is pure spaghetti madness... :(
|
||||
|
@ -1010,15 +1031,7 @@ void AIPlayer::Tick(RunListEvent* ev)
|
|||
doPlayerInvincibility(pPlayer);
|
||||
|
||||
if (pPlayer->nQuake != 0)
|
||||
{
|
||||
pPlayer->nQuake = -pPlayer->nQuake;
|
||||
if (pPlayer->nQuake > 0)
|
||||
{
|
||||
pPlayer->nQuake -= 2.;
|
||||
if (pPlayer->nQuake < 0)
|
||||
pPlayer->nQuake = 0;
|
||||
}
|
||||
}
|
||||
doPlayerQuake(pPlayer);
|
||||
|
||||
pPlayer->Angles.doViewYaw(&pPlayer->input);
|
||||
|
||||
|
|
Loading…
Reference in a new issue