mirror of
https://github.com/Mr-X-GTA/YimMenu.git
synced 2025-01-07 18:03:34 +08:00
64f833c74f
* chore: Changed detour_hook extension back to cpp * chore(crossmap): split crossmap into header and source file * chore(logger): rename macro's to code style * chore(logger): removed unused local variable * chore(benchmark): changed extension to C++ header * chore: cleanup pickup_rewards file * chore(gta): cleanup code and file naming * chore(CanApplyData): Removed unused code
32 lines
724 B
C++
32 lines
724 B
C++
#include "common.hpp"
|
|
#include "pointers.hpp"
|
|
#include "script_local.hpp"
|
|
#include "gta/script_thread.hpp"
|
|
|
|
namespace big
|
|
{
|
|
script_local::script_local(rage::scrThread* thread, std::size_t index) :
|
|
m_index(index), m_stack(thread->m_stack)
|
|
{
|
|
}
|
|
script_local::script_local(PVOID stack, std::size_t index) :
|
|
m_index(index), m_stack(stack)
|
|
{
|
|
}
|
|
|
|
script_local script_local::at(std::ptrdiff_t index)
|
|
{
|
|
return script_local(m_stack, m_index + index);
|
|
}
|
|
|
|
script_local script_local::at(std::ptrdiff_t index, std::size_t size)
|
|
{
|
|
return script_local(m_stack, m_index + 1 + (index * size));
|
|
}
|
|
|
|
void *script_local::get()
|
|
{
|
|
return reinterpret_cast<uintptr_t*>((uintptr_t)m_stack + (m_index * sizeof(uintptr_t)));
|
|
}
|
|
}
|