From c393bf7af2457fb8402b1da80dcb08f6ebf7d956 Mon Sep 17 00:00:00 2001 From: gsemaj Date: Wed, 5 May 2021 03:54:25 -0400 Subject: [PATCH] Prioritize ID match over type match when finding a path for an NPC --- src/TableData.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/TableData.cpp b/src/TableData.cpp index 0741a89..4bddb73 100644 --- a/src/TableData.cpp +++ b/src/TableData.cpp @@ -49,6 +49,9 @@ static NPCPath* findApplicablePath(int32_t id, int32_t type) { break; } + if (match != nullptr) + break; // early break for ID matches, since ID has higher priority than type + // search target types for (int32_t pType : _path->targetTypes) { if (type == pType) match = &(*_path);