Only display area warning if player is headnig towards it.

This commit is contained in:
Steve 2015-11-02 18:07:02 +00:00
parent ef1d0b4f4a
commit d0f19cc322
1 changed files with 4 additions and 4 deletions

View File

@ -92,28 +92,28 @@ void drawRadarRangeWarning(void)
y = (int)player->y / GRID_CELL_HEIGHT; y = (int)player->y / GRID_CELL_HEIGHT;
leaving = 0; leaving = 0;
if (x <= 4) if (x <= 4 && player->dx < 0)
{ {
blitRotated(radarWarningTexture, SCREEN_WIDTH - 85, SCREEN_HEIGHT - 85, 270); blitRotated(radarWarningTexture, SCREEN_WIDTH - 85, SCREEN_HEIGHT - 85, 270);
leaving = 1; leaving = 1;
} }
if (y <= 4) if (y <= 4 && player->dy < 0)
{ {
blitRotated(radarWarningTexture, SCREEN_WIDTH - 85, SCREEN_HEIGHT - 85, 0); blitRotated(radarWarningTexture, SCREEN_WIDTH - 85, SCREEN_HEIGHT - 85, 0);
leaving = 1; leaving = 1;
} }
if (x >= GRID_SIZE - 4) if (x >= GRID_SIZE - 4 && player->dx > 0)
{ {
blitRotated(radarWarningTexture, SCREEN_WIDTH - 85, SCREEN_HEIGHT - 85, 90); blitRotated(radarWarningTexture, SCREEN_WIDTH - 85, SCREEN_HEIGHT - 85, 90);
leaving = 1; leaving = 1;
} }
if (y >= GRID_SIZE - 4) if (y >= GRID_SIZE - 4 && player->dy > 0)
{ {
blitRotated(radarWarningTexture, SCREEN_WIDTH - 85, SCREEN_HEIGHT - 85, 180); blitRotated(radarWarningTexture, SCREEN_WIDTH - 85, SCREEN_HEIGHT - 85, 180);