From 7f43ed3f9dd3a899a5891e17c3eaa58dc3fd29ad Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Fri, 15 Oct 2010 15:40:36 +0000 Subject: SCI: Changed the check for vertex_min into an assert (thanks wjp) svn-id: r53504 --- engines/sci/engine/kpathing.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'engines') diff --git a/engines/sci/engine/kpathing.cpp b/engines/sci/engine/kpathing.cpp index 4ea28ed903..cfd455e7b6 100644 --- a/engines/sci/engine/kpathing.cpp +++ b/engines/sci/engine/kpathing.cpp @@ -1311,8 +1311,10 @@ static void AStar(PathfindingState *s) { } } + assert(vertex_min != 0); // the vertex cost should never be bigger than HUGE_DISTANCE + // Check if we are done - if (vertex_min == s->vertex_end || !vertex_min) + if (vertex_min == s->vertex_end) break; // Move vertex from set open to set closed -- cgit v1.2.3