mirror of
https://github.com/Mr-X-GTA/YimMenu.git
synced 2025-01-05 17:13:29 +08:00
feat(Global): Added pointer to local player ped
This commit is contained in:
parent
44fd2ee600
commit
814cce7d55
@ -12,6 +12,8 @@ namespace big
|
|||||||
{
|
{
|
||||||
looped::system_screen_size();
|
looped::system_screen_size();
|
||||||
looped::system_update_players();
|
looped::system_update_players();
|
||||||
|
|
||||||
|
looped::system_update_pointers();
|
||||||
}QUEUE_JOB_END_CLAUSE
|
}QUEUE_JOB_END_CLAUSE
|
||||||
|
|
||||||
QUEUE_JOB_BEGIN_CLAUSE()
|
QUEUE_JOB_BEGIN_CLAUSE()
|
||||||
|
@ -16,6 +16,7 @@ namespace big
|
|||||||
static void self_no_ragdoll();
|
static void self_no_ragdoll();
|
||||||
|
|
||||||
static void system_update_players();
|
static void system_update_players();
|
||||||
|
static void system_update_pointers();
|
||||||
static void system_screen_size();
|
static void system_screen_size();
|
||||||
|
|
||||||
static void weapons_cage_gun();
|
static void weapons_cage_gun();
|
||||||
|
11
BigBaseV2/src/backend/looped/system/update_pointers.cpp
Normal file
11
BigBaseV2/src/backend/looped/system/update_pointers.cpp
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
#include "backend/looped/looped.hpp"
|
||||||
|
#include "gta_util.hpp"
|
||||||
|
|
||||||
|
namespace big
|
||||||
|
{
|
||||||
|
void looped::system_update_pointers()
|
||||||
|
{
|
||||||
|
if (g_local_player == nullptr)
|
||||||
|
g_local_player = gta_util::get_local_ped();
|
||||||
|
}
|
||||||
|
}
|
@ -51,8 +51,9 @@
|
|||||||
#include "logger.hpp"
|
#include "logger.hpp"
|
||||||
|
|
||||||
#include "core/globals.hpp"
|
#include "core/globals.hpp"
|
||||||
|
#include "core/class/CPed.hpp"
|
||||||
#include "gta/player.hpp"
|
#include "gta/player.hpp"
|
||||||
// #include "settings.h"
|
|
||||||
|
|
||||||
namespace big
|
namespace big
|
||||||
{
|
{
|
||||||
@ -65,4 +66,6 @@ namespace big
|
|||||||
inline HANDLE g_main_thread{};
|
inline HANDLE g_main_thread{};
|
||||||
inline DWORD g_main_thread_id{};
|
inline DWORD g_main_thread_id{};
|
||||||
inline std::atomic_bool g_running{ true };
|
inline std::atomic_bool g_running{ true };
|
||||||
|
|
||||||
|
inline CPed* g_local_player;
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "common.hpp"
|
#include "common.hpp"
|
||||||
#include "gta/array.hpp"
|
#include "gta/array.hpp"
|
||||||
#include "gta/ped_factory.hpp"
|
#include "core/class/CPedFactory.hpp"
|
||||||
#include "gta/player.hpp"
|
#include "gta/player.hpp"
|
||||||
#include "gta/script_thread.hpp"
|
#include "gta/script_thread.hpp"
|
||||||
#include "gta/tls_context.hpp"
|
#include "gta/tls_context.hpp"
|
||||||
@ -25,7 +25,7 @@ namespace big::gta_util
|
|||||||
{
|
{
|
||||||
if (auto ped = ped_factory->m_local_ped)
|
if (auto ped = ped_factory->m_local_ped)
|
||||||
{
|
{
|
||||||
return ped->m_playerinfo;
|
return ped->m_player_info;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user