From ed6b0ae37618e98f859927f1697e86ffafc51620 Mon Sep 17 00:00:00 2001 From: Steve Date: Sat, 12 Mar 2016 12:10:14 +0000 Subject: [PATCH] Don't point to jumpgate on HUD if it's inactive. --- src/battle/hud.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/battle/hud.c b/src/battle/hud.c index b98ffac..85eda92 100644 --- a/src/battle/hud.c +++ b/src/battle/hud.c @@ -330,7 +330,7 @@ static void drawPlayerTargeter(void) float angle; int x, y; - if (player->target || battle.missionTarget || battle.jumpgate) + if (player->target || battle.missionTarget || (battle.jumpgate && battle.jumpgate->systemPower)) { if (player->target) { @@ -376,7 +376,7 @@ static void drawPlayerTargeter(void) blitRotated(targetPointer, x - battle.camera.x, y - battle.camera.y, angle); } - if (battle.jumpgate) + if (battle.jumpgate && battle.jumpgate->systemPower) { angle = getAngle(player->x, player->y, battle.jumpgate->x, battle.jumpgate->y); x = player->x; @@ -456,7 +456,7 @@ static void drawDistancesInfo(void) y = 11; - if (player->target != NULL) + if (player->target) { drawText(SCREEN_WIDTH - 15, y, 18, TA_RIGHT, colors.red, player->target->name); @@ -469,7 +469,7 @@ static void drawDistancesInfo(void) y += 25; } - if (battle.missionTarget != NULL) + if (battle.missionTarget) { distance = distanceToKM(player->x, player->y, battle.missionTarget->x, battle.missionTarget->y); @@ -478,7 +478,7 @@ static void drawDistancesInfo(void) y += 25; } - if (battle.jumpgate != NULL) + if (battle.jumpgate && battle.jumpgate->systemPower) { distance = distanceToKM(player->x, player->y, battle.jumpgate->x, battle.jumpgate->y);