-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2894f26
commit 48c8143
Showing
7 changed files
with
74 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,29 @@ | ||
#pragma once | ||
#include "Distributor.h" | ||
|
||
namespace Hooks { | ||
|
||
struct InitItemImpl | ||
{ | ||
static void Thunk(RE::TESObjectREFR* a_ref) | ||
{ | ||
func(a_ref); | ||
|
||
if (a_ref->HasContainer()) { | ||
Distributor::RuntimeDistribute(a_ref); | ||
} | ||
} | ||
static inline REL::Relocation<decltype(Thunk)> func; | ||
static inline constexpr std::size_t idx{ 0x13 }; | ||
|
||
static void Install() | ||
{ | ||
stl::write_vfunc<RE::TESObjectREFR, InitItemImpl>(); | ||
logger::info("Installed Object Reference hook"); | ||
} | ||
}; | ||
|
||
void Install(); | ||
} | ||
#pragma once | ||
#include "Distributor.h" | ||
|
||
namespace Hooks | ||
{ | ||
|
||
struct InitItemImpl | ||
{ | ||
static void Thunk(RE::TESObjectREFR* a_ref) | ||
{ | ||
func(a_ref); | ||
|
||
if (a_ref->HasContainer()) { | ||
Distributor::RuntimeDistribute(a_ref); | ||
} | ||
} | ||
|
||
inline static REL::Relocation<decltype(Thunk)> func; | ||
inline static constexpr std::size_t idx{ 0x13 }; | ||
|
||
static void Install() | ||
{ | ||
stl::write_vfunc<RE::TESObjectREFR, InitItemImpl>(); | ||
logger::info("Installed Object Reference hook"); | ||
} | ||
}; | ||
|
||
void Install(); | ||
} // namespace Hooks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
#include "Hooks.h" | ||
|
||
void Hooks::Install() { | ||
Hooks::InitItemImpl::Install(); | ||
} | ||
#include "Hooks.h" | ||
|
||
void Hooks::Install() | ||
{ | ||
Hooks::InitItemImpl::Install(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters