From f51557f8015306a980899b815761680e53d73784 Mon Sep 17 00:00:00 2001 From: Steve Date: Sun, 8 May 2016 19:00:14 +0100 Subject: [PATCH] Prevent player from moving if system power <= 0. --- src/battle/player.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/battle/player.c b/src/battle/player.c index bd2a0b4..ada6069 100644 --- a/src/battle/player.c +++ b/src/battle/player.c @@ -93,7 +93,7 @@ void doPlayer(void) battle.boostTimer = MIN(battle.boostTimer + 1, BOOST_RECHARGE_TIME); battle.ecmTimer = MIN(battle.ecmTimer + 1, ECM_RECHARGE_TIME); - if (player->alive == ALIVE_ALIVE) + if (player->alive == ALIVE_ALIVE && player->systemPower > 0) { self = player; @@ -142,16 +142,6 @@ void doPlayer(void) initPlayerSelect(); } } - - /* really only used in challenge mode */ - if (player->systemPower <= 0 && battle.status == MS_IN_PROGRESS) - { - if (game.currentMission->challengeData.isChallenge) - { - addHudMessage(colors.red, _("Challenge Failed!")); - failMission(); - } - } if (battle.status == MS_IN_PROGRESS) { @@ -163,6 +153,16 @@ void doPlayer(void) player->missiles = 999; } } + + /* really only used in challenge mode */ + if (player->systemPower <= 0 && battle.status == MS_IN_PROGRESS) + { + if (game.currentMission->challengeData.isChallenge) + { + addHudMessage(colors.red, _("Challenge Failed!")); + failMission(); + } + } if (battle.boostTimer == (int)BOOST_FINISHED_TIME) {