From bc0ebf678e1b5fc6317971054b9fc78a20d6c82f Mon Sep 17 00:00:00 2001 From: Allanis Date: Sun, 16 Jun 2013 16:05:04 +0100 Subject: [PATCH] [Fix] Pathfinding doesn't seg fault anymore? --- src/space.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/space.c b/src/space.c index c26b8bb..f1ace4c 100644 --- a/src/space.c +++ b/src/space.c @@ -313,10 +313,10 @@ StarSystem** system_getJumpPath(int* njumps, char* sysstart, char* sysend) { neighbour = A_newNode(&systems_stack[cur->sys->jumps[i]], cur); cost = A_g(cur) + 1; - if(A_in(open, neighbour->sys) && (cost < A_g(neighbour))) + if(A_in(open, neighbour->sys)) open = A_rm(open, neighbour->sys); // New path is better. - if(A_in(closed, neighbour->sys) && (cost < A_g(neighbour))) + if(A_in(closed, neighbour->sys)) closed = A_rm(closed, neighbour->sys); // Shouldn't happen. if(!A_in(open, neighbour->sys) && !A_in(closed, neighbour->sys)) {