Skip to content

Commit fc2ded4

Browse files
committed
fix: convert free standing relocations to functions
1 parent 2c475ee commit fc2ded4

11 files changed

Lines changed: 64 additions & 14 deletions

include/RE/C/CombatUtilities.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,11 @@ namespace RE
4343
return func(a_projectilePos, a_projectileVelocity, a_projectileGravity, a_targetPos, a_heading, a_trajectoryPos);
4444
}
4545

46-
inline static REL::Relocation<float> fWorldGravity{ ID::CombatUtilities::WorldGravity };
46+
inline float GetWorldGravity()
47+
{
48+
static REL::Relocation<float> value{ ID::CombatUtilities::WorldGravity };
49+
return value.get();
50+
}
4751

4852
inline bool IsActorUsingMelee(Actor* a_actor)
4953
{

include/RE/I/ImageSpaceEffectFullScreenBlur.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@ namespace RE
2222
virtual bool IsActive() override; // 08
2323
virtual bool UpdateParams(ImageSpaceEffectParam* a_param) override; // 09
2424

25-
inline static REL::Relocation<bool*> bDisable{ ID::ImageSpaceEffectFullScreenBlur::Disable };
25+
inline static bool* GetDisable()
26+
{
27+
static REL::Relocation<bool*> value{ ID::ImageSpaceEffectFullScreenBlur::Disable };
28+
return value.get();
29+
}
2630

2731
// members
2832
ImageSpaceTexture buffer[3]; // B0

include/RE/I/ImageSpaceEffectGetHit.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@ namespace RE
2222
virtual bool IsActive() override; // 08
2323
virtual bool UpdateParams(ImageSpaceEffectParam* a_param) override; // 09
2424

25-
inline static REL::Relocation<bool*> bDisable{ ID::ImageSpaceEffectGetHit::Disable };
25+
inline static bool* GetDisable()
26+
{
27+
static REL::Relocation<bool*> value{ ID::ImageSpaceEffectGetHit::Disable };
28+
return value.get();
29+
}
2630

2731
// members
2832
float* data; // B0

include/RE/I/ImageSpaceEffectHDR.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,11 @@ namespace RE
1919
virtual void Shutdown() override; // 04
2020
virtual bool UpdateParams(ImageSpaceEffectParam* a_param) override; // 09
2121

22-
inline static REL::Relocation<bool*> UsePipboyScreenMask{ ID::ImageSpaceEffectHDR::UsePipboyScreenMask };
22+
inline static bool* GetUsePipboyScreenMask()
23+
{
24+
static REL::Relocation<bool*> value{ ID::ImageSpaceEffectHDR::UsePipboyScreenMask };
25+
return value.get();
26+
}
2327
};
2428
static_assert(sizeof(ImageSpaceEffectHDR) == 0xB0);
2529
}

include/RE/I/ImageSpaceEffectPipboyScreen.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,11 @@ namespace RE
2121
virtual void ReturnTextures() override; // 06
2222
virtual bool UpdateParams(ImageSpaceEffectParam* a_param) override; // 09
2323

24-
inline static REL::Relocation<bool*> bPowerArmorPipboy{ ID::ImageSpaceEffectPipboyScreen::PowerArmorPipboy };
24+
inline static bool* GetPowerArmorPipboy()
25+
{
26+
static REL::Relocation<bool*> value{ ID::ImageSpaceEffectPipboyScreen::PowerArmorPipboy };
27+
return value.get();
28+
}
2529

2630
// members
2731
NiPointer<NiTexture> scanlineTexture; // B0

include/RE/I/ImageSpaceEffectRadialBlur.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,11 @@ namespace RE
1818
virtual bool IsActive() override; // 08
1919
virtual bool UpdateParams(ImageSpaceEffectParam* a_param) override; // 09
2020

21-
inline static REL::Relocation<bool*> bDisable{ ID::ImageSpaceEffectRadialBlur::Disable };
21+
inline static bool* GetDisable()
22+
{
23+
static REL::Relocation<bool*> value{ ID::ImageSpaceEffectRadialBlur::Disable };
24+
return value.get();
25+
}
2226
};
2327
static_assert(sizeof(ImageSpaceEffectRadialBlur) == 0xB0);
2428
}

include/RE/I/ImageSpaceEffectTemporalAA.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,11 @@ namespace RE
1919
virtual bool IsActive() override; // 08
2020
virtual bool UpdateParams(ImageSpaceEffectParam* a_param) override; // 09
2121

22-
inline static REL::Relocation<std::uint32_t*> MaskS{ ID::ImageSpaceEffectTemporalAA::MaskS };
22+
inline static std::uint32_t* GetMaskS()
23+
{
24+
static REL::Relocation<std::uint32_t*> value{ ID::ImageSpaceEffectTemporalAA::MaskS };
25+
return value.get();
26+
}
2327

2428
// members
2529
float previousInvTexSizeX; // B0

include/RE/P/PowerArmor.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ namespace RE
5757
return func(a_furniture, a_force3DUpdate, a_tempItemToAdd, a_hideCore);
5858
}
5959

60-
inline static REL::Relocation<SettingT<GameSettingCollection>*> fNewBatteryCapacity{ ID::PowerArmor::fNewBatteryCapacity };
60+
[[nodiscard]] inline SettingT<GameSettingCollection>* GetNewBatteryCapacity()
61+
{
62+
static REL::Relocation<SettingT<GameSettingCollection>*> value{ ID::PowerArmor::fNewBatteryCapacity };
63+
return value.get();
64+
}
6165
}
6266
}

include/RE/S/SCRIPT_FUNCTION.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,17 @@ namespace RE
6868
std::uint16_t paramCount{ 0 }; // 22
6969
SCRIPT_PARAMETER* parameters{ nullptr }; // 28
7070
ExecuteFunction_t* executeFunction{ nullptr }; // 30
71-
CompileFunction_t* compileFunction{ CompileFunction.get() }; // 38
71+
CompileFunction_t* compileFunction{ GetCompileFunction() }; // 38
7272
ConditionFunction_t* conditionFunction{ nullptr }; // 40
7373
bool editorFilter{ false }; // 48
7474
bool invalidatesCellList{ false }; // 49
7575

7676
private:
77-
inline static REL::Relocation<CompileFunction_t*> CompileFunction{ ID::SCRIPT_FUNCTION::CompileFunction };
77+
[[nodiscard]] inline static CompileFunction_t* GetCompileFunction()
78+
{
79+
static REL::Relocation<CompileFunction_t*> value{ ID::SCRIPT_FUNCTION::CompileFunction };
80+
return value.get();
81+
}
7882
};
7983
static_assert(sizeof(SCRIPT_FUNCTION) == 0x50);
8084
}

include/RE/W/Workshop.h

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -374,8 +374,22 @@ namespace RE
374374
return func(a_recipe, a_filter);
375375
}
376376

377-
inline static REL::Relocation<PlacementItemData*> CurrentPlacementItemData{ ID::Workshop::CurrentPlacementItemData };
378-
inline static REL::Relocation<std::uint16_t*> CurrentRow{ ID::Workshop::CurrentRow };
379-
inline static REL::Relocation<ObjectRefHandle*> PlacementItem{ ID::Workshop::PlacementItem };
377+
[[nodiscard]] inline PlacementItemData* GetCurrentPlacementItemData()
378+
{
379+
static REL::Relocation<PlacementItemData*> value{ ID::Workshop::CurrentPlacementItemData };
380+
return value.get();
381+
}
382+
383+
[[nodiscard]] inline std::uint16_t* GetCurrentRow()
384+
{
385+
static REL::Relocation<std::uint16_t*> value{ ID::Workshop::CurrentRow };
386+
return value.get();
387+
}
388+
389+
[[nodiscard]] inline ObjectRefHandle* GetPlacementItem()
390+
{
391+
static REL::Relocation<ObjectRefHandle*> value{ ID::Workshop::PlacementItem };
392+
return value.get();
393+
}
380394
}
381395
}

0 commit comments

Comments
 (0)