From 84aee22dc19704b891acb7a2acc63793f7667d22 Mon Sep 17 00:00:00 2001 From: powerof3 <32599957+powerof3@users.noreply.github.com> Date: Tue, 28 May 2024 17:23:25 +0530 Subject: [PATCH] Add `AIFormulas::GetSoundLevelValue` --- include/RE/A/AIFormulas.h | 3 +++ src/RE/A/AIFormulas.cpp | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/include/RE/A/AIFormulas.h b/include/RE/A/AIFormulas.h index 7345f8716..453f38427 100644 --- a/include/RE/A/AIFormulas.h +++ b/include/RE/A/AIFormulas.h @@ -2,11 +2,14 @@ namespace RE { + enum class SOUND_LEVEL; + class Actor; class TESForm; namespace AIFormulas { std::int32_t ComputePickpocketSuccess(float a_thiefSkill, float a_targetSkill, std::uint32_t a_valueStolen, float a_weightStolen, Actor* a_thief, Actor* a_target, bool a_isDetected, TESForm* a_itemPickpocketing); + std::int32_t GetSoundLevelValue(SOUND_LEVEL a_soundLevel); } } diff --git a/src/RE/A/AIFormulas.cpp b/src/RE/A/AIFormulas.cpp index be4683f6d..4f2c065fb 100644 --- a/src/RE/A/AIFormulas.cpp +++ b/src/RE/A/AIFormulas.cpp @@ -1,5 +1,7 @@ #include "RE/A/AIFormulas.h" +#include "RE/S/SoundLevels.h" + namespace RE { namespace AIFormulas @@ -10,5 +12,12 @@ namespace RE REL::Relocation func{ RELOCATION_ID(25822, 26379) }; return func(a_thiefSkill, a_targetSkill, a_valueStolen, a_weightStolen, a_thief, a_target, a_isDetected, a_itemPickpocketing); } + + std::int32_t GetSoundLevelValue(SOUND_LEVEL a_soundLevel) + { + using func_t = decltype(GetSoundLevelValue); + REL::Relocation func{ RELOCATION_ID(25814, 26367) }; + return func(a_soundLevel); + } } }