mirror of
https://github.com/Mr-X-GTA/YimMenu.git
synced 2025-06-18 15:17:23 +08:00
feat(CPed): In vehicle property is a bit field, check against bit instead of one value
This commit is contained in:
parent
2fa3ebd789
commit
d8b7b8801a
@ -7,7 +7,7 @@ namespace big
|
|||||||
if (!g.vehicle.god_mode || g_local_player == nullptr || g_local_player->m_vehicle == nullptr)
|
if (!g.vehicle.god_mode || g_local_player == nullptr || g_local_player->m_vehicle == nullptr)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (g_local_player->m_in_vehicle == 0x0)
|
if (g_local_player->m_in_vehicle & (int)ePedTask::TASK_FOOT)
|
||||||
{
|
{
|
||||||
g_local_player->m_vehicle->m_deform_god = 0x8C;
|
g_local_player->m_vehicle->m_deform_god = 0x8C;
|
||||||
g_local_player->m_vehicle->m_godmode = 0x1;
|
g_local_player->m_vehicle->m_godmode = 0x1;
|
||||||
|
@ -101,6 +101,14 @@ namespace big
|
|||||||
EXP_TAG_SUBMARINE_BIG = 82,
|
EXP_TAG_SUBMARINE_BIG = 82,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum class ePedTask
|
||||||
|
{
|
||||||
|
TASK_NONE,
|
||||||
|
TASK_FOOT = 1 << 4,
|
||||||
|
TASK_UNK = 1 << 5,
|
||||||
|
TASK_DRIVING = 1 << 6
|
||||||
|
};
|
||||||
|
|
||||||
enum class eRemoteEvent
|
enum class eRemoteEvent
|
||||||
{
|
{
|
||||||
Bounty = 1294995624,
|
Bounty = 1294995624,
|
||||||
|
@ -11,7 +11,7 @@ namespace big
|
|||||||
ImGui::SetNextWindowPos({ 50, 50 }, ImGuiCond_FirstUseEver);
|
ImGui::SetNextWindowPos({ 50, 50 }, ImGuiCond_FirstUseEver);
|
||||||
if (g.window.handling && ImGui::Begin("Handling", &g.window.handling))
|
if (g.window.handling && ImGui::Begin("Handling", &g.window.handling))
|
||||||
{
|
{
|
||||||
if (g_local_player == nullptr || g_local_player->m_vehicle == nullptr || g_local_player->m_in_vehicle == 0x10)
|
if (g_local_player == nullptr || g_local_player->m_vehicle == nullptr || g_local_player->m_in_vehicle & (int)ePedTask::TASK_FOOT)
|
||||||
{
|
{
|
||||||
ImGui::Text("Please enter a vehicle.");
|
ImGui::Text("Please enter a vehicle.");
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ namespace big
|
|||||||
|
|
||||||
int vehicle_service::attempt_save()
|
int vehicle_service::attempt_save()
|
||||||
{
|
{
|
||||||
if (g_local_player == nullptr || g_local_player->m_in_vehicle == 0x10 || g_local_player->m_vehicle == nullptr)
|
if (g_local_player == nullptr || g_local_player->m_in_vehicle & (int)ePedTask::TASK_FOOT || g_local_player->m_vehicle == nullptr)
|
||||||
return -1;
|
return -1;
|
||||||
if (m_handling_backup.find(g_local_player->m_vehicle->m_handling->m_model_hash) != m_handling_backup.end())
|
if (m_handling_backup.find(g_local_player->m_vehicle->m_handling->m_model_hash) != m_handling_backup.end())
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user