Skip to content

Commit 899287a

Browse files
committed
fix(Locals): Use appropriate offsets for game version.
1 parent 40218bd commit 899287a

2 files changed

Lines changed: 11 additions & 5 deletions

File tree

src/lua/bindings/locals.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ namespace lua::locals
1010
static std::remove_pointer_t<T> null{};
1111
auto thread = big::gta_util::find_script_thread(rage::joaat(script));
1212
if (thread)
13-
return big::script_local(thread->m_stack, index).as<T>();
13+
return big::script_local(thread, index).as<T>();
1414

1515
return &null;
1616
}

src/script_local.cpp

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,23 @@
99
*/
1010

1111
#include "script_local.hpp"
12+
#include "gta_util.hpp"
1213

13-
#include "common.hpp"
14+
// clang-format off
15+
#include "util/header_wrappers/include_as_enhaced.hpp"
1416
#include "gta/script_thread.hpp"
15-
#include "pointers.hpp"
17+
#include "util/header_wrappers/include_as_legacy.hpp"
18+
#include "gta/script_thread.hpp"
19+
#include "util/header_wrappers/clear_include.hpp"
20+
// clang-format on
21+
1622

1723
namespace big
1824
{
1925
script_local::script_local(rage::scrThread* thread, std::size_t index) :
20-
m_index(index),
21-
m_stack(thread->m_stack)
26+
m_index(index)
2227
{
28+
m_stack = AUTO_CROSS_ACCESS(rage::scrThread, thread, ->m_stack);
2329
}
2430
script_local::script_local(PVOID stack, std::size_t index) :
2531
m_index(index),

0 commit comments

Comments
 (0)