From 04ab6f4640dce747b42025b2d52f99016fd37a2b Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Thu, 23 Mar 2023 19:47:41 +1100 Subject: [PATCH] - Exhumed: Split out player invincibility code. --- source/games/exhumed/src/player.cpp | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/source/games/exhumed/src/player.cpp b/source/games/exhumed/src/player.cpp index c810333c0..aded68eef 100644 --- a/source/games/exhumed/src/player.cpp +++ b/source/games/exhumed/src/player.cpp @@ -947,6 +947,22 @@ static void doPlayerInvisibility(Player* const pPlayer) } } +//--------------------------------------------------------------------------- +// +// +// +//--------------------------------------------------------------------------- + +static void doPlayerInvincibility(Player* const pPlayer) +{ + pPlayer->invincibility--; + + if (pPlayer->invincibility == 150 && pPlayer->nPlayer == nLocalPlayer) + { + PlayAlert(GStrings("TXT_EX_INVINCEX")); + } +} + //--------------------------------------------------------------------------- // // this function is pure spaghetti madness... :( @@ -991,12 +1007,7 @@ void AIPlayer::Tick(RunListEvent* ev) doPlayerInvisibility(pPlayer); if (pPlayer->invincibility > 0) - { - pPlayer->invincibility--; - if (pPlayer->invincibility == 150 && nPlayer == nLocalPlayer) { - PlayAlert(GStrings("TXT_EX_INVINCEX")); - } - } + doPlayerInvincibility(pPlayer); if (pPlayer->nQuake != 0) {