Skip to content

Commit

Permalink
feat: add static to all Relocation<T> uses
Browse files Browse the repository at this point in the history
  • Loading branch information
qudix committed Jun 8, 2024
1 parent 7d4ee48 commit 55030ee
Show file tree
Hide file tree
Showing 112 changed files with 597 additions and 597 deletions.
2 changes: 1 addition & 1 deletion CommonLibF4/include/RE/Bethesda/ActiveEffect.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ namespace RE
bool CheckDisplacementSpellOnTarget()
{
using func_t = decltype(&ActiveEffect::CheckDisplacementSpellOnTarget);
REL::Relocation<func_t> func{ REL::ID(1415178) };
static REL::Relocation<func_t> func{ REL::ID(1415178) };
return func(this);
}

Expand Down
2 changes: 1 addition & 1 deletion CommonLibF4/include/RE/Bethesda/ActorValueInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ namespace RE
[[nodiscard]] static ActorValue* GetSingleton()
{
using func_t = decltype(&ActorValue::GetSingleton);
REL::Relocation<func_t> func{ REL::ID(2189587) };
static REL::Relocation<func_t> func{ REL::ID(2189587) };
return func();
}

Expand Down
28 changes: 14 additions & 14 deletions CommonLibF4/include/RE/Bethesda/Archive2.h
Original file line number Diff line number Diff line change
Expand Up @@ -168,35 +168,35 @@ namespace RE::BSResource::Archive2
ErrorCode DoOpen() override // 01
{
using func_t = decltype(&ReaderStream::DoOpen);
REL::Relocation<func_t> func{ REL::ID(762048) };
static REL::Relocation<func_t> func{ REL::ID(762048) };
return func(this);
}

void DoClose() override // 02
{
using func_t = decltype(&ReaderStream::DoClose);
REL::Relocation<func_t> func{ REL::ID(109149) };
static REL::Relocation<func_t> func{ REL::ID(109149) };
return func(this);
}

std::uint64_t DoGetKey() const override // 03
{
using func_t = decltype(&ReaderStream::DoGetKey);
REL::Relocation<func_t> func{ REL::ID(772817) };
static REL::Relocation<func_t> func{ REL::ID(772817) };
return func(this);
}

void DoClone(BSTSmartPointer<Stream>& a_result) const override // 05
{
using func_t = decltype(&ReaderStream::DoClone);
REL::Relocation<func_t> func{ REL::ID(855081) };
static REL::Relocation<func_t> func{ REL::ID(855081) };
return func(this, a_result);
}

ErrorCode DoRead(void* a_buffer, std::uint64_t a_bytes, std::uint64_t& a_read) const override // 06
{
using func_t = decltype(&ReaderStream::DoRead);
REL::Relocation<func_t> func{ REL::ID(1359347) };
static REL::Relocation<func_t> func{ REL::ID(1359347) };
return func(this, a_buffer, a_bytes, a_read);
}

Expand All @@ -209,14 +209,14 @@ namespace RE::BSResource::Archive2
ErrorCode DoSeek(std::int64_t a_offset, SeekMode a_whence, std::uint64_t& a_pos) const override // 09
{
using func_t = decltype(&ReaderStream::DoSeek);
REL::Relocation<func_t> func{ REL::ID(1000164) };
static REL::Relocation<func_t> func{ REL::ID(1000164) };
return func(this, a_offset, a_whence, a_pos);
}

ErrorCode DoPrefetchAll(std::uint32_t a_priority) const override // 0E
{
using func_t = decltype(&ReaderStream::DoPrefetchAll);
REL::Relocation<func_t> func{ REL::ID(1518821) };
static REL::Relocation<func_t> func{ REL::ID(1518821) };
return func(this, a_priority);
}

Expand All @@ -229,7 +229,7 @@ namespace RE::BSResource::Archive2
ErrorCode DoCreateAsync(BSTSmartPointer<AsyncStream>& a_result) const override // 10
{
using func_t = decltype(&ReaderStream::DoCreateAsync);
REL::Relocation<func_t> func{ REL::ID(893405) };
static REL::Relocation<func_t> func{ REL::ID(893405) };
return func(this, a_result);
}

Expand Down Expand Up @@ -272,22 +272,22 @@ namespace RE::BSResource::Archive2
ErrorCode DoOpen() override // 01
{
using func_t = decltype(&AsyncReaderStream::DoOpen);
REL::Relocation<func_t> func{ REL::ID(1401160) };
static REL::Relocation<func_t> func{ REL::ID(1401160) };
return func(this);
}

void DoClose() override // 02
{
using func_t = decltype(&AsyncReaderStream::DoClose);
REL::Relocation<func_t> func{ REL::ID(883012) };
static REL::Relocation<func_t> func{ REL::ID(883012) };
return func(this);
}

void DoClone(
BSTSmartPointer<AsyncStream>& a_result) const override // 05
{
using func_t = decltype(&AsyncReaderStream::DoClone);
REL::Relocation<func_t> func{ REL::ID(803750) };
static REL::Relocation<func_t> func{ REL::ID(803750) };
return func(this, a_result);
}

Expand All @@ -297,7 +297,7 @@ namespace RE::BSResource::Archive2
std::uint64_t a_offset) const override // 06
{
using func_t = decltype(&AsyncReaderStream::DoStartRead);
REL::Relocation<func_t> func{ REL::ID(1215072) };
static REL::Relocation<func_t> func{ REL::ID(1215072) };
return func(this, a_buffer, a_bytes, a_offset);
}

Expand All @@ -307,7 +307,7 @@ namespace RE::BSResource::Archive2
std::uint64_t a_offset) const override // 07
{
using func_t = decltype(&AsyncReaderStream::DoStartPacketAlignedBufferedRead);
REL::Relocation<func_t> func{ REL::ID(603387) };
static REL::Relocation<func_t> func{ REL::ID(603387) };
return func(this, a_buffer, a_bytes, a_offset);
}

Expand All @@ -330,7 +330,7 @@ namespace RE::BSResource::Archive2
bool a_block) override // 0B
{
using func_t = decltype(&AsyncReaderStream::DoWait);
REL::Relocation<func_t> func{ REL::ID(2269399) };
static REL::Relocation<func_t> func{ REL::ID(2269399) };
return func(this, a_transferred, a_block);
}

Expand Down
6 changes: 3 additions & 3 deletions CommonLibF4/include/RE/Bethesda/BGSCreatedObjectManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,21 +53,21 @@ namespace RE

[[nodiscard]] static BGSCreatedObjectManager* GetSingleton()
{
REL::Relocation<BGSCreatedObjectManager**> singleton{ REL::ID(1000678) };
static REL::Relocation<BGSCreatedObjectManager**> singleton{ REL::ID(1000678) };
return *singleton;
}

void DecrementRef(AlchemyItem* a_alchItem)
{
using func_t = decltype(&BGSCreatedObjectManager::DecrementRef);
REL::Relocation<func_t> func{ REL::ID(230928) };
static REL::Relocation<func_t> func{ REL::ID(230928) };
return func(this, a_alchItem);
}

void IncrementRef(AlchemyItem* a_alchItem)
{
using func_t = decltype(&BGSCreatedObjectManager::IncrementRef);
REL::Relocation<func_t> func{ REL::ID(1042515) };
static REL::Relocation<func_t> func{ REL::ID(1042515) };
return func(this, a_alchItem);
}

Expand Down
8 changes: 4 additions & 4 deletions CommonLibF4/include/RE/Bethesda/BGSDefaultObjectManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ namespace RE

[[nodiscard]] inline std::span<DEFAULT_OBJECT_DATA, 394> GetDefaultObjectData()
{
REL::Relocation<DEFAULT_OBJECT_DATA(*)[394]> data{ REL::ID(838886) };
static REL::Relocation<DEFAULT_OBJECT_DATA(*)[394]> data{ REL::ID(838886) };
return { *data };
}

Expand All @@ -446,7 +446,7 @@ namespace RE
[[nodiscard]] static BGSDefaultObjectManager* GetSingleton()
{
using func_t = decltype(&BGSDefaultObjectManager::GetSingleton);
REL::Relocation<func_t> func{ REL::ID(484974) };
static REL::Relocation<func_t> func{ REL::ID(484974) };
return func();
}

Expand Down Expand Up @@ -489,7 +489,7 @@ namespace RE

[[nodiscard]] static BSTArray<BGSDefaultObject*>* GetSingleton()
{
REL::Relocation<BSTArray<BGSDefaultObject*>**> singleton{ REL::ID(2690473) };
static REL::Relocation<BSTArray<BGSDefaultObject*>**> singleton{ REL::ID(2690473) };
return *singleton;
}

Expand All @@ -508,7 +508,7 @@ namespace RE
BGSDefaultObject* ctor(const char* a_name, ENUM_FORM_ID a_formType, const char* a_description)
{
using func_t = decltype(&BGSDefaultObject::ctor);
REL::Relocation<func_t> func{ REL::ID(2197003) };
static REL::Relocation<func_t> func{ REL::ID(2197003) };
return func(this, a_name, a_formType, a_description);
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,21 @@ namespace RE
public:
[[nodiscard]] static BGSDynamicPersistenceManager* GetSingleton()
{
REL::Relocation<BGSDynamicPersistenceManager**> singleton{ REL::ID(109630) };
static REL::Relocation<BGSDynamicPersistenceManager**> singleton{ REL::ID(109630) };
return *singleton;
}

bool PromoteReference(TESObjectREFR* a_refr, TESForm* a_owner)
{
using func_t = decltype(&BGSDynamicPersistenceManager::PromoteReference);
REL::Relocation<func_t> func{ REL::ID(1300345) };
static REL::Relocation<func_t> func{ REL::ID(1300345) };
return func(this, a_refr, a_owner);
}

bool DemoteReference(TESObjectREFR* a_refr, TESForm* a_owner, bool a_allowActors = false)
{
using func_t = decltype(&BGSDynamicPersistenceManager::DemoteReference);
REL::Relocation<func_t> func{ REL::ID(222813) };
static REL::Relocation<func_t> func{ REL::ID(222813) };
return func(this, a_refr, a_owner, a_allowActors);
}

Expand Down
2 changes: 1 addition & 1 deletion CommonLibF4/include/RE/Bethesda/BGSEntryPoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ namespace RE
inline void HandleEntryPoint(ENTRY_POINT a_entryPoint, Actor* a_perkOwner, Args... a_args)
{
using func_t = decltype(&BGSEntryPoint::HandleEntryPoint<Args...>);
REL::Relocation<func_t> func{ REL::ID(2206243) };
static REL::Relocation<func_t> func{ REL::ID(2206243) };
return func(a_entryPoint, a_perkOwner, a_args...);
}
}
Expand Down
4 changes: 2 additions & 2 deletions CommonLibF4/include/RE/Bethesda/BGSInventoryInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,14 @@ namespace RE

[[nodiscard]] static BGSInventoryInterface* GetSingleton()
{
REL::Relocation<BGSInventoryInterface**> singleton{ REL::ID(2689299) };
static REL::Relocation<BGSInventoryInterface**> singleton{ REL::ID(2689299) };
return *singleton;
}

[[nodiscard]] const BGSInventoryItem* RequestInventoryItem(const std::uint32_t& a_handleID) const
{
using func_t = decltype(&BGSInventoryInterface::RequestInventoryItem);
REL::Relocation<func_t> func{ REL::ID(2194009) };
static REL::Relocation<func_t> func{ REL::ID(2194009) };
return func(this, a_handleID);
}

Expand Down
10 changes: 5 additions & 5 deletions CommonLibF4/include/RE/Bethesda/BGSInventoryItem.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ namespace RE
bool FindAndWriteStackData(StackDataCompareFunctor& a_compareFunc, StackDataWriteFunctor& a_writeFunc, bool a_manualMerge, ObjectRefHandle a_owner)
{
using func_t = decltype(&BGSInventoryItem::FindAndWriteStackData);
REL::Relocation<func_t> func{ REL::ID(770140) };
static REL::Relocation<func_t> func{ REL::ID(770140) };
return func(this, a_compareFunc, a_writeFunc, a_manualMerge, a_owner);
}

Expand All @@ -148,21 +148,21 @@ namespace RE
[[nodiscard]] const char* GetDisplayFullName(std::uint32_t a_stackID)
{
using func_t = decltype(&BGSInventoryItem::GetDisplayFullName);
REL::Relocation<func_t> func{ REL::ID(2194079) };
static REL::Relocation<func_t> func{ REL::ID(2194079) };
return func(this, a_stackID);
}

[[nodiscard]] TBO_InstanceData* GetInstanceData(std::uint32_t a_stackID)
{
using func_t = decltype(&BGSInventoryItem::GetInstanceData);
REL::Relocation<func_t> func{ REL::ID(2194072) };
static REL::Relocation<func_t> func{ REL::ID(2194072) };
return func(this, a_stackID);
}

[[nodiscard]] std::int32_t GetInventoryValue(std::uint32_t a_stackID, bool a_scale) const
{
using func_t = decltype(&BGSInventoryItem::GetInventoryValue);
REL::Relocation<func_t> func{ REL::ID(2194099) };
static REL::Relocation<func_t> func{ REL::ID(2194099) };
return func(this, a_stackID, a_scale);
}

Expand All @@ -183,7 +183,7 @@ namespace RE
virtual void WriteDataImpl(TESBoundObject& a_baseObj, BGSInventoryItem::Stack& a_stack) override // 01
{
using func_t = decltype(&ApplyChangesFunctor::WriteDataImpl);
REL::Relocation<func_t> func{ REL::ID(2223194) };
static REL::Relocation<func_t> func{ REL::ID(2223194) };
return func(this, a_baseObj, a_stack);
}

Expand Down
12 changes: 6 additions & 6 deletions CommonLibF4/include/RE/Bethesda/BGSMod.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ namespace RE::BGSMod
{
[[nodiscard]] inline BSTHashMap<const Mod*, TESObjectMISC*>& GetAllLooseMods()
{
REL::Relocation<BSTHashMap<const Mod*, TESObjectMISC*>*> mods{ REL::ID(1108112), -0x8 };
static REL::Relocation<BSTHashMap<const Mod*, TESObjectMISC*>*> mods{ REL::ID(1108112), -0x8 };
return *mods;
}

Expand Down Expand Up @@ -166,28 +166,28 @@ namespace RE::BGSMod
static void FindModsForLooseMod(TESObjectMISC* a_looseMod, BSScrapArray<BGSMod::Attachment::Mod*>& a_result)
{
using func_t = decltype(&Mod::FindModsForLooseMod);
REL::Relocation<func_t> func{ REL::ID(410363) };
static REL::Relocation<func_t> func{ REL::ID(410363) };
return func(a_looseMod, a_result);
}

void GetData(Data& a_data) const
{
using func_t = decltype(&Mod::GetData);
REL::Relocation<func_t> func{ REL::ID(33658) };
static REL::Relocation<func_t> func{ REL::ID(33658) };
return func(this, a_data);
}

TESObjectMISC* GetLooseMod()
{
using func_t = decltype(&Mod::GetLooseMod);
REL::Relocation<func_t> func{ REL::ID(1359613) };
static REL::Relocation<func_t> func{ REL::ID(1359613) };
return func(this);
}

void SetLooseMod(TESObjectMISC* misc)
{
using func_t = decltype(&Mod::SetLooseMod);
REL::Relocation<func_t> func{ REL::ID(123132) };
static REL::Relocation<func_t> func{ REL::ID(123132) };
return func(this, misc);
}

Expand Down Expand Up @@ -250,7 +250,7 @@ namespace RE::BGSMod
static void CreateInstanceDataForObjectAndExtra(TESBoundObject& a_object, ExtraDataList& a_extra, const INSTANCE_FILTER* a_filter, bool a_useDefault)
{
using func_t = decltype(&Items::CreateInstanceDataForObjectAndExtra);
REL::Relocation<func_t> func{ REL::ID(147297) };
static REL::Relocation<func_t> func{ REL::ID(147297) };
return func(a_object, a_extra, a_filter, a_useDefault);
}

Expand Down
4 changes: 2 additions & 2 deletions CommonLibF4/include/RE/Bethesda/BGSSaveLoad.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,14 @@ namespace RE

[[nodiscard]] static BGSSaveLoadManager* GetSingleton()
{
REL::Relocation<BGSSaveLoadManager**> singleton{ REL::ID(2697802) };
static REL::Relocation<BGSSaveLoadManager**> singleton{ REL::ID(2697802) };
return *singleton;
}

void QueueSaveLoadTask(QUEUED_TASK a_task)
{
using func_t = decltype(&BGSSaveLoadManager::QueueSaveLoadTask);
REL::Relocation<func_t> func{ REL::ID(2228080) };
static REL::Relocation<func_t> func{ REL::ID(2228080) };
return func(this, a_task);
}

Expand Down
Loading

0 comments on commit 55030ee

Please sign in to comment.