Skip to content

Commit c5ca4d1

Browse files
authored
feat: merge pull request #8 from RunnerScrab/RunnerScrab_FixNativeMethodBinding
Runner scrab fix native method binding
2 parents fe16e31 + c61624b commit c5ca4d1

File tree

4 files changed

+11
-14
lines changed

4 files changed

+11
-14
lines changed

include/RE/B/BSScriptUtil.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -940,10 +940,7 @@ namespace RE::BSScript
940940
const auto args = [&]<class T>(std::in_place_type_t<T>, std::size_t a_index) {
941941
if (a_stackFrame.size > a_index) {
942942
return UnpackVariable<detail::decay_t<T>>(
943-
a_stack.GetStackFrameVariable(
944-
pframe,
945-
static_cast<std::uint32_t>(a_index),
946-
page));
943+
a_stackFrame.GetVariable(static_cast<std::uint32_t>(a_index),page));
947944
} else {
948945
assert(false);
949946
return T();

include/RE/IDs.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,12 @@ namespace RE::ID
301301
inline constexpr REL::ID ctor{ 0 }; // 196325
302302
inline constexpr REL::ID dtor{ 0 }; // 196333
303303
inline constexpr REL::ID GetStackFrameVariable{ 0 }; // 196367
304-
inline constexpr REL::ID GetPageForFrame{ 0 }; // 196366
304+
inline constexpr REL::ID GetPageForFrame{ 138020 }; // 196366
305+
}
306+
307+
namespace StackFrame
308+
{
309+
inline constexpr REL::ID GetVariable{ 84986 };
305310
}
306311

307312
namespace Internal

include/RE/S/Stack.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,6 @@ namespace RE::BSScript
7373
return func(this, a_frame);
7474
}
7575

76-
[[nodiscard]] Variable& GetStackFrameVariable(const StackFrame* a_frame, std::uint32_t a_index, std::uint32_t a_pageHint)
77-
{
78-
using func_t = decltype(&Stack::GetStackFrameVariable);
79-
static REL::Relocation<func_t> func{ ID::BSScript::Stack::GetStackFrameVariable };
80-
return func(this, a_frame, a_index, a_pageHint);
81-
}
82-
8376
// members
8477
IMemoryPagePolicy* policy; // 08
8578
void* unk10; // 10 - something to do with guards, guardPolicy maybe?

include/RE/S/StackFrame.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,11 @@ namespace RE::BSScript
1818
return parent->GetPageForFrame(this);
1919
}
2020

21-
[[nodiscard]] Variable& GetStackFrameVariable(std::uint32_t a_index, std::uint32_t a_pageHint) const
21+
[[nodiscard]] Variable& GetVariable(std::uint32_t a_index, std::uint32_t a_pageHint) const
2222
{
23-
return parent->GetStackFrameVariable(this, a_index, a_pageHint);
23+
using func_t = decltype(&StackFrame::GetVariable);
24+
static REL::Relocation<func_t> func{ ID::BSScript::StackFrame::GetVariable };
25+
return func(this, a_index, a_pageHint);
2426
}
2527

2628
// members

0 commit comments

Comments
 (0)