Prioritize ID match over type match when finding a path for an NPC

This commit is contained in:
gsemaj 2021-05-05 03:54:25 -04:00 committed by Gent Semaj
parent 72b62cd5a4
commit c393bf7af2

View File

@ -49,6 +49,9 @@ static NPCPath* findApplicablePath(int32_t id, int32_t type) {
break; break;
} }
if (match != nullptr)
break; // early break for ID matches, since ID has higher priority than type
// search target types // search target types
for (int32_t pType : _path->targetTypes) { for (int32_t pType : _path->targetTypes) {
if (type == pType) match = &(*_path); if (type == pType) match = &(*_path);