Fix path matching breaking prematurely

This commit is contained in:
gsemaj 2021-05-05 14:59:24 -04:00 committed by Gent Semaj
parent d41122157f
commit ebd3b7b75a
1 changed files with 8 additions and 4 deletions

View File

@ -45,8 +45,10 @@ static NPCPath* findApplicablePath(int32_t id, int32_t type) {
for (auto _path = Transport::NPCPaths.begin(); _path != Transport::NPCPaths.end(); _path++) {
// search target IDs
for (int32_t pID : _path->targetIDs) {
if (id == pID) match = &(*_path);
break;
if (id == pID) {
match = &(*_path);
break;
}
}
if (match != nullptr)
@ -54,8 +56,10 @@ static NPCPath* findApplicablePath(int32_t id, int32_t type) {
// search target types
for (int32_t pType : _path->targetTypes) {
if (type == pType) match = &(*_path);
break;
if (type == pType) {
match = &(*_path);
break;
}
}
if (match != nullptr)