From b0498a15bf6f1782f1429ffbd0b03c187f61d7c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Lam?= Date: Mon, 16 Nov 2020 20:44:05 +0100 Subject: [PATCH] ksys/act: Fix one matching issue --- data/uking_functions.csv | 2 +- src/KingSystem/ActorSystem/actInfoData.cpp | 21 +++++++++++---------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/data/uking_functions.csv b/data/uking_functions.csv index 72ae1e2f..d775e642 100644 --- a/data/uking_functions.csv +++ b/data/uking_functions.csv @@ -73370,7 +73370,7 @@ 0x0000007100d2f6f0,ActorInfoData::hasTagByName,232, 0x0000007100d2f7d8,ActorInfoData::hasTagWithIter,296, 0x0000007100d2f900,ActorInfoData::hasTag,224, -0x0000007100d2f9e0,ActorInfoData::getActorSameGroupActorName,256,_ZNK4ksys3act8InfoData21getSameGroupActorNameEPKc? +0x0000007100d2f9e0,ActorInfoData::getActorSameGroupActorName,256,_ZNK4ksys3act8InfoData21getSameGroupActorNameEPKc 0x0000007100d2fae0,ActorInfoData::__auto1,136, 0x0000007100d2fb68,ActorInfoData::getTerrainTextures,452, 0x0000007100d2fd2c,ActorInfoData::getDrops,228, diff --git a/src/KingSystem/ActorSystem/actInfoData.cpp b/src/KingSystem/ActorSystem/actInfoData.cpp index 036ab557..54499e40 100644 --- a/src/KingSystem/ActorSystem/actInfoData.cpp +++ b/src/KingSystem/ActorSystem/actInfoData.cpp @@ -193,19 +193,20 @@ void InfoData::getHomeAreas(const char* actor, HomeAreas& info) const { } } -// NON_MATCHING: stack const char* InfoData::getSameGroupActorName(const char* actor) const { al::ByamlIter iter; - if (getActorIter(&iter, actor, false)) { - al::ByamlHashIter hash_iter{iter.getRootNode()}; - al::ByamlData data; - if (hash_iter.getDataByKey(&data, mSystemSameGroupActorNameIdx)) { - const char* name; - if (iter.tryConvertString(&name, &data)) - return name; + return [&] { + if (getActorIter(&iter, actor, false)) { + al::ByamlHashIter hash_iter{iter.getRootNode()}; + al::ByamlData data; + if (hash_iter.getDataByKey(&data, mSystemSameGroupActorNameIdx)) { + const char* name; + if (iter.tryConvertString(&name, &data)) + return name; + } } - } - return sead::SafeString::cEmptyString.cstr(); + return sead::SafeString::cEmptyString.cstr(); + }(); } const char* InfoData::getString(const char* actor, const char* key,