From b4d3bb72a829024bef8fc3923285ac6e5416b967 Mon Sep 17 00:00:00 2001
From: Allanis <allanis@saracraft.net>
Date: Thu, 16 May 2013 19:18:12 +0100
Subject: [PATCH] [Fix] Silly map bug.

---
 src/map.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/map.c b/src/map.c
index 2666214..6117d3e 100644
--- a/src/map.c
+++ b/src/map.c
@@ -214,10 +214,12 @@ static void map_render(double bx, double by, double w, double h) {
     glShadeModel(GL_FLAT);
   }
   // Selected planet.
-  sys = &systems_stack[map_selected];
-  COLOUR(cRed);
-  gl_drawCircleInRect(x + sys->pos.x*map_zoom, y + sys->pos.y*map_zoom,
-                      r+3., bx, by, w, h);
+  if(map_selected != -1) {
+    sys = &systems_stack[map_selected];
+    COLOUR(cRed);
+    gl_drawCircleInRect(x + sys->pos.x*map_zoom, y + sys->pos.y*map_zoom,
+                        r+3., bx, by, w, h);
+  }
 }
 
 // Map event handling.
@@ -333,6 +335,7 @@ void map_clear(void) {
 void map_jump(void) {
   int j;
 
+  map_selected = -1;
   map_xpos = cur_system->pos.x;
   map_ypos = cur_system->pos.y;