Improved video interruption patch

This commit is contained in:
Eddoursul 2023-12-13 17:10:02 +01:00
parent e5e81477e6
commit e9d5357d67
2 changed files with 7 additions and 5 deletions

BIN
SKSE/Plugins/EnderalSE.dll (Stored with Git LFS)

Binary file not shown.

View File

@ -7,9 +7,11 @@ namespace BinkInterruptPatch
{
struct BinkListener
{
static bool thunk()
static bool thunk(RE::BGSMoviePlayer* moviePlayer, bool bInterruptible)
{
auto result = func();
if (!bInterruptible) {
return true;
}
if (SKSE::WinAPI::GetKeyState(VK_SPACE) & 0x8000 || SKSE::WinAPI::GetKeyState(VK_ESCAPE) & 0x8000 || SKSE::WinAPI::GetKeyState(VK_LBUTTON) & 0x8000 || SKSE::WinAPI::GetKeyState(VK_RBUTTON) & 0x8000 || SKSE::WinAPI::GetKeyState(VK_LMENU) & 0x8000) {
return false;
@ -26,14 +28,14 @@ namespace BinkInterruptPatch
}
}
return result;
return true;
}
static inline REL::Relocation<decltype(thunk)> func;
};
void Install()
{
REL::Relocation<std::uintptr_t> target{ REL::RelocationID(87887, 90256), REL::Relocate(0x9F, 0x16F) };
REL::Relocation<std::uintptr_t> target{ REL::RelocationID(87890, 90259), REL::Relocate(0x22, 0x21) };
auto& trampoline = SKSE::GetTrampoline();
SKSE::AllocTrampoline(14);