Skip to content

Commit

Permalink
Replaced GetActorValueIdFromName with ActorValueList::LookupActorValu…
Browse files Browse the repository at this point in the history
…eByName
  • Loading branch information
fireundubh committed May 9, 2022
1 parent 43e2bd4 commit 7b15b5f
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 12 deletions.
7 changes: 0 additions & 7 deletions src/Papyrus/ActorValueHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,6 @@

namespace ActorValueHelper
{
auto GetActorValueIdFromName(const char* a_name) -> std::int32_t
{
using func_t = decltype(&ActorValueHelper::GetActorValueIdFromName);
REL::Relocation<func_t> func{ RELOCATION_ID(26570, 27203) };
return func(a_name);
}

auto ActorValueToString(const RE::ActorValue a_actorValue) -> RE::BSFixedString
{
switch (a_actorValue) {
Expand Down
1 change: 0 additions & 1 deletion src/Papyrus/ActorValueHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@

namespace ActorValueHelper
{
auto GetActorValueIdFromName(const char* a_name) -> std::int32_t;
auto ActorValueToString(RE::ActorValue a_actorValue) -> RE::BSFixedString;
}
2 changes: 1 addition & 1 deletion src/Papyrus/PapyrusObjectREFR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ namespace PapyrusObjectREFR
}

if (const auto actor = a_ref->As<RE::Actor>(); actor) {
const auto actorValueId = ActorValueHelper::GetActorValueIdFromName(a_actorValue.c_str());
const auto actorValueId = RE::ActorValueList::GetSingleton()->LookupActorValueByName(a_actorValue);
const auto actorValue = static_cast<RE::ActorValue>(actorValueId);
return actor->GetPermanentActorValue(actorValue);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Papyrus/PapyrusRace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<RE::ActorValue>(actorValueId);

for (const auto& [skill, bonus] : a_race->data.skillBoosts) {
Expand Down
4 changes: 2 additions & 2 deletions src/Version.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 7b15b5f

Please # to comment.