- Exhumed: Change doPlayerDeathRestart() to do an early return instead of nested branches.

This commit is contained in:
Mitchell Richters 2023-03-26 09:56:55 +11:00
parent b6c3753d3a
commit dcfab3e57c

View file

@ -1565,12 +1565,11 @@ static void doPlayerAngles(Player* const pPlayer)
static bool doPlayerDeathRestart(Player* const pPlayer)
{
if (pPlayer->input.actions & SB_OPEN)
{
if (!(pPlayer->input.actions & SB_OPEN) || pPlayer->nAction < 16)
return true;
pPlayer->input.actions &= ~SB_OPEN;
if (pPlayer->nAction >= 16)
{
if (pPlayer->nPlayer == nLocalPlayer)
{
StopAllSounds();
@ -1598,8 +1597,6 @@ static bool doPlayerDeathRestart(Player* const pPlayer)
DoGameOverScene(currentLevel->levelNumber == 20);
return false;
}
}
}
return true;
}