From 7b15b5f77e167f0311ceabc3c524fdfec4714c00 Mon Sep 17 00:00:00 2001 From: fireundubh Date: Sun, 8 May 2022 21:39:03 -0700 Subject: [PATCH] Replaced GetActorValueIdFromName with ActorValueList::LookupActorValueByName --- src/Papyrus/ActorValueHelper.cpp | 7 ------- src/Papyrus/ActorValueHelper.h | 1 - src/Papyrus/PapyrusObjectREFR.cpp | 2 +- src/Papyrus/PapyrusRace.cpp | 2 +- src/Version.h | 4 ++-- 5 files changed, 4 insertions(+), 12 deletions(-) diff --git a/src/Papyrus/ActorValueHelper.cpp b/src/Papyrus/ActorValueHelper.cpp index 4eba71d..c893cc7 100644 --- a/src/Papyrus/ActorValueHelper.cpp +++ b/src/Papyrus/ActorValueHelper.cpp @@ -4,13 +4,6 @@ namespace ActorValueHelper { - auto GetActorValueIdFromName(const char* a_name) -> std::int32_t - { - using func_t = decltype(&ActorValueHelper::GetActorValueIdFromName); - REL::Relocation func{ RELOCATION_ID(26570, 27203) }; - return func(a_name); - } - auto ActorValueToString(const RE::ActorValue a_actorValue) -> RE::BSFixedString { switch (a_actorValue) { diff --git a/src/Papyrus/ActorValueHelper.h b/src/Papyrus/ActorValueHelper.h index c4b3a87..b04d9ba 100644 --- a/src/Papyrus/ActorValueHelper.h +++ b/src/Papyrus/ActorValueHelper.h @@ -4,6 +4,5 @@ namespace ActorValueHelper { - auto GetActorValueIdFromName(const char* a_name) -> std::int32_t; auto ActorValueToString(RE::ActorValue a_actorValue) -> RE::BSFixedString; } diff --git a/src/Papyrus/PapyrusObjectREFR.cpp b/src/Papyrus/PapyrusObjectREFR.cpp index dab82e0..06e4c2d 100644 --- a/src/Papyrus/PapyrusObjectREFR.cpp +++ b/src/Papyrus/PapyrusObjectREFR.cpp @@ -188,7 +188,7 @@ namespace PapyrusObjectREFR } if (const auto actor = a_ref->As(); actor) { - const auto actorValueId = ActorValueHelper::GetActorValueIdFromName(a_actorValue.c_str()); + const auto actorValueId = RE::ActorValueList::GetSingleton()->LookupActorValueByName(a_actorValue); const auto actorValue = static_cast(actorValueId); return actor->GetPermanentActorValue(actorValue); } diff --git a/src/Papyrus/PapyrusRace.cpp b/src/Papyrus/PapyrusRace.cpp index e43f57b..2f535b5 100644 --- a/src/Papyrus/PapyrusRace.cpp +++ b/src/Papyrus/PapyrusRace.cpp @@ -13,7 +13,7 @@ namespace PapyrusRace return -1; } - const auto actorValueId = ActorValueHelper::GetActorValueIdFromName(a_actorValue.c_str()); + const auto actorValueId = RE::ActorValueList::GetSingleton()->LookupActorValueByName(a_actorValue); const auto actorValue = static_cast(actorValueId); for (const auto& [skill, bonus] : a_race->data.skillBoosts) { diff --git a/src/Version.h b/src/Version.h index 152b930..3228a23 100644 --- a/src/Version.h +++ b/src/Version.h @@ -6,8 +6,8 @@ #define FIRE_VERSION_MAJOR 1 #define FIRE_VERSION_MINOR 0 -#define FIRE_VERSION_PATCH 3 -#define FIRE_VERSION_BETA 0 +#define FIRE_VERSION_PATCH 8 +#define FIRE_VERSION_BETA 1 #define FIRE_VERSION_VERSTRING \ MAKE_STR(FIRE_VERSION_MAJOR) \ "." MAKE_STR(FIRE_VERSION_MINOR) "." MAKE_STR(FIRE_VERSION_PATCH) "." MAKE_STR(FIRE_VERSION_BETA)