From d0f19cc3221a28dfeb35d134c870247bd5048bee Mon Sep 17 00:00:00 2001 From: Steve Date: Mon, 2 Nov 2015 18:07:02 +0000 Subject: [PATCH] Only display area warning if player is headnig towards it. --- src/battle/radar.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/battle/radar.c b/src/battle/radar.c index 183bd99..da6115f 100644 --- a/src/battle/radar.c +++ b/src/battle/radar.c @@ -92,28 +92,28 @@ void drawRadarRangeWarning(void) y = (int)player->y / GRID_CELL_HEIGHT; leaving = 0; - if (x <= 4) + if (x <= 4 && player->dx < 0) { blitRotated(radarWarningTexture, SCREEN_WIDTH - 85, SCREEN_HEIGHT - 85, 270); leaving = 1; } - if (y <= 4) + if (y <= 4 && player->dy < 0) { blitRotated(radarWarningTexture, SCREEN_WIDTH - 85, SCREEN_HEIGHT - 85, 0); leaving = 1; } - if (x >= GRID_SIZE - 4) + if (x >= GRID_SIZE - 4 && player->dx > 0) { blitRotated(radarWarningTexture, SCREEN_WIDTH - 85, SCREEN_HEIGHT - 85, 90); leaving = 1; } - if (y >= GRID_SIZE - 4) + if (y >= GRID_SIZE - 4 && player->dy > 0) { blitRotated(radarWarningTexture, SCREEN_WIDTH - 85, SCREEN_HEIGHT - 85, 180);