- Exhumed: Split out player torch code.

This commit is contained in:
Mitchell Richters 2023-03-23 19:46:18 +11:00
parent 8f21a89abc
commit b51623b415

View file

@ -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)
{