Skip to content

Commit

Permalink
Make relocations static
Browse files Browse the repository at this point in the history
  • Loading branch information
powerof3 committed Jul 31, 2024
1 parent ee97a2f commit f846624
Show file tree
Hide file tree
Showing 11 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion extern/CommonLibSSE
Submodule CommonLibSSE updated 244 files
2 changes: 1 addition & 1 deletion src/Experimental/UpdateGameTimers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace Experimental::UpdateGameTimers
static void UpdateTimers(RE::PlayerCharacter* a_player)
{
using func_t = decltype(&UpdateTimers);
REL::Relocation<func_t> func{ REL_ID(39410, 40485) };
static REL::Relocation<func_t> func{ REL_ID(39410, 40485) };
return func(a_player);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Fixes/IsFurnitureAnimTypeForFurniture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace Fixes::IsFurnitureAnimTypeForFurniture
static std::uint32_t GetEquippedFurnitureType(RE::Actor* a_actor)
{
using func_t = decltype(&GetEquippedFurnitureType);
REL::Relocation<func_t> func{ REL_ID(36720, 37732) };
static REL::Relocation<func_t> func{ REL_ID(36720, 37732) };
return func(a_actor);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Fixes/ToggleCollision.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace Fixes::ToggleCollision
static void ToggleGlobalCollision()
{
using func_t = decltype(&ToggleGlobalCollision);
REL::Relocation<func_t> func{ REL_ID(13224, 13375) };
static REL::Relocation<func_t> func{ REL_ID(13224, 13375) };
return func();
}

Expand Down
2 changes: 1 addition & 1 deletion src/Fixes/ToggleGlobalAI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace Fixes::ToggleGlobalAI
static void ClearPath(RE::Actor* a_actor)
{
using func_t = decltype(&ClearPath);
REL::Relocation<func_t> func{ REL_ID(36802, 37818) };
static REL::Relocation<func_t> func{ REL_ID(36802, 37818) };
return func(a_actor);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Fixes/UnderwaterCamera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace Fixes::UnderWaterCamera
static void UpdateUnderWaterVariables(RE::TESWaterSystem* a_manager, bool a_underWater, float a_waterHeight)
{
using func_t = decltype(&UpdateUnderWaterVariables);
REL::Relocation<func_t> func{ REL_ID(31409, 32216) };
static REL::Relocation<func_t> func{ REL_ID(31409, 32216) };
return func(a_manager, a_underWater, a_waterHeight);
}
};
Expand Down
2 changes: 1 addition & 1 deletion src/Fixes/ValidateScreenshotFolder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace Fixes::ValidateScreenshotFolder
RE::Setting* set_ini_string(RE::Setting* a_setting, const char* a_str)
{
using func_t = decltype(&set_ini_string);
REL::Relocation<func_t> func{ RELOCATION_ID(73882, 75619) };
static REL::Relocation<func_t> func{ RELOCATION_ID(73882, 75619) };
return func(a_setting, a_str);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Fixes/WornRestrictionsForWeapons.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ namespace Fixes::WornRestrictionsForWeapons
auto wornRestrictionList = a_effect->data->data.wornRestrictions;
auto keywordForm = a_item->data->object->As<RE::BGSKeywordForm>();

if (!wornRestrictionList || !keywordForm) {
if (!wornRestrictionList) {
return true;
}

Expand Down
2 changes: 1 addition & 1 deletion src/Tweaks/FactionStealing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace Tweaks::FactionStealing
static std::int32_t GetFavorCost(RE::TESNPC* a_player, RE::TESNPC* a_owner)
{
using func_t = decltype(&GetFavorCost);
REL::Relocation<func_t> func{ REL_ID(23626, 24078) };
static REL::Relocation<func_t> func{ REL_ID(23626, 24078) };
return func(a_player, a_owner);
}

Expand Down
4 changes: 2 additions & 2 deletions src/Tweaks/GameTimeAffectsSounds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ namespace Tweaks::GameTimeAffectsSounds
static void Play(RE::BSAudioManager* a_manager, std::int32_t a_soundID)
{
using func_t = decltype(&Play);
REL::Relocation<func_t> func{ REL_ID(66408, 67671) };
static REL::Relocation<func_t> func{ REL_ID(66408, 67671) };
return func(a_manager, a_soundID);
}
};
Expand All @@ -69,7 +69,7 @@ namespace Tweaks::GameTimeAffectsSounds
static void PlayAfter(RE::BSAudioManager* a_manager, std::int32_t a_soundID, std::uint32_t a_unk03)
{
using func_t = decltype(&PlayAfter);
REL::Relocation<func_t> func{ REL_ID(66409, 67672) };
static REL::Relocation<func_t> func{ REL_ID(66409, 67672) };
return func(a_manager, a_soundID, a_unk03);
}
};
Expand Down
4 changes: 2 additions & 2 deletions src/Tweaks/SitToWait.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ namespace Tweaks::SitToWait
static bool ProcessMenu(const RE::BSFixedString& a_menuName, RE::UI_MESSAGE_TYPE a_type, bool a_unk03)
{
using func_t = decltype(&ProcessMenu);
REL::Relocation<func_t> func{ REL_ID(80077, 82180) };
static REL::Relocation<func_t> func{ REL_ID(80077, 82180) };
return func(a_menuName, a_type, a_unk03);
}

static bool CanSleepWait(RE::PlayerCharacter* a_player, RE::TESObjectREFR* a_furniture)
{
using func_t = decltype(&CanSleepWait);
REL::Relocation<func_t> func{ REL_ID(39371, 40443) };
static REL::Relocation<func_t> func{ REL_ID(39371, 40443) };
return func(a_player, a_furniture);
}

Expand Down

0 comments on commit f846624

Please sign in to comment.