[Fix] Hyperspace paths no longer appear if you drag them out of the map.

This commit is contained in:
Allanis 2013-03-10 17:16:39 +00:00
parent 6365ad186a
commit 11f4eed18c

View File

@ -125,7 +125,7 @@ static void map_update(void) {
// Render the map as a custom widget. // Render the map as a custom widget.
static void map_render(double bx, double by, double w, double h) { static void map_render(double bx, double by, double w, double h) {
int i, j; int i, j;
double x, y, r; double x, y, r, tx, ty;
StarSystem* sys; StarSystem* sys;
glColour* col; glColour* col;
@ -166,14 +166,20 @@ static void map_render(double bx, double by, double w, double h) {
else col = &cInert; else col = &cInert;
glBegin(GL_LINE_STRIP); glBegin(GL_LINE_STRIP);
ACOLOUR(*col, 0.); ACOLOUR(*col, 0.);
glVertex2d(x+sys->pos.x, y+sys->pos.y); tx = x + sys->pos.x;
ty = y + sys->pos.y;
if(!((tx < bx) || (tx > bx + w) || (ty < by) || (ty > by+h)))
glVertex2d(tx, ty);
COLOUR(*col); COLOUR(*col);
glVertex2d( tx += (systems_stack[sys->jumps[j]].pos.x - sys->pos.x)/2.;
x+sys->pos.x+(systems_stack[sys->jumps[j]].pos.x-sys->pos.x)/2., ty += (systems_stack[sys->jumps[j]].pos.y - sys->pos.y)/2.;
y+sys->pos.y+(systems_stack[sys->jumps[j]].pos.y-sys->pos.y)/2.); if(!((tx < bx) || (tx > bx+w) || (ty < by) || (ty > by+h)))
glVertex2d(tx, ty);
ACOLOUR(*col, 0.); ACOLOUR(*col, 0.);
glVertex2d(x+systems_stack[sys->jumps[j]].pos.x, tx += (systems_stack[sys->jumps[j]].pos.x - sys->pos.x)/2.;
y+systems_stack[sys->jumps[j]].pos.y); ty += (systems_stack[sys->jumps[j]].pos.y - sys->pos.y)/2.;
if(!((tx < bx) || (tx > bx+w) || (ty < by) || (ty > by+h)))
glVertex2d(tx, ty);
glEnd(); glEnd();
} }
glShadeModel(GL_FLAT); glShadeModel(GL_FLAT);