From 83f8fc5a90c5b5260d9be65aa10153ce26cd6afd Mon Sep 17 00:00:00 2001 From: qndel Date: Mon, 12 Oct 2020 03:06:01 +0200 Subject: [PATCH] path_get_node2 cleanup --- Source/path.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Source/path.cpp b/Source/path.cpp index 70970c4f4..996910ad8 100644 --- a/Source/path.cpp +++ b/Source/path.cpp @@ -283,9 +283,12 @@ PATHNODE *path_get_node1(int dx, int dy) PATHNODE *path_get_node2(int dx, int dy) { PATHNODE *result = pnode_ptr->NextNode; - while (result != NULL && (result->x != dx || result->y != dy)) + while (result != NULL) { + if (result->x == dx && result->y == dy) + return result; result = result->NextNode; - return result; + } + return NULL; } /**