mirror of
https://github.com/ZDoom/Raze.git
synced 2024-11-15 00:42:08 +00:00
- Exhumed: Split out player torch code.
This commit is contained in:
parent
8f21a89abc
commit
b51623b415
1 changed files with 22 additions and 15 deletions
|
@ -885,6 +885,27 @@ static void ClearSpaceBar(int nPlayer)
|
|||
buttonMap.ClearButton(gamefunc_Open);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
static void doPlayerTorch(Player* const pPlayer)
|
||||
{
|
||||
pPlayer->nTorch--;
|
||||
|
||||
if (pPlayer->nTorch == 0)
|
||||
{
|
||||
SetTorch(pPlayer->nPlayer, 0);
|
||||
}
|
||||
else if (pPlayer->nPlayer != nLocalPlayer)
|
||||
{
|
||||
nFlashDepth = 5;
|
||||
AddFlash(pPlayer->pActor->sector(), pPlayer->pActor->spr.pos, 0);
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
// this function is pure spaghetti madness... :(
|
||||
|
@ -920,21 +941,7 @@ void AIPlayer::Tick(RunListEvent* ev)
|
|||
pDopple->spr.picnum = pPlayerActor->spr.picnum;
|
||||
|
||||
if (pPlayer->nTorch > 0)
|
||||
{
|
||||
pPlayer->nTorch--;
|
||||
if (pPlayer->nTorch == 0)
|
||||
{
|
||||
SetTorch(nPlayer, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (nPlayer != nLocalPlayer)
|
||||
{
|
||||
nFlashDepth = 5;
|
||||
AddFlash(pPlayerActor->sector(), pPlayerActor->spr.pos, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
doPlayerTorch(pPlayer);
|
||||
|
||||
if (pPlayer->nDouble > 0)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue