fix: Context Menu crash & Vehicle God mode (#1571)

* fix(ContextMenu): nullptr dereference while drawing box
* fix(ESP): Vehicle God mode check if ped is actually driving
This commit is contained in:
Andreas Maerten 2023-06-30 20:38:30 +02:00 committed by GitHub
parent e5a33e2b32
commit a43d3d8824
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 4 deletions

View File

@ -30,7 +30,11 @@ namespace big
MISC::GET_MODEL_DIMENSIONS(hash, &min, &max);
const auto dimensions = (max - min) * 0.5f;
const auto& position = *m_pointer->m_navigation->get_position();
// sanity check
if (!m_pointer || !m_pointer->m_navigation)
return;
// make copy just in case
const auto position = *m_pointer->m_navigation->get_position();
rage::fvector3 front_upper_right, back_lower_left;
front_upper_right.x = position.x + dimensions.y * forward.x + dimensions.x * right.x + dimensions.z * up.x;

View File

@ -102,10 +102,12 @@ namespace big
}
}
if (auto player_vehicle = plyr->get_current_vehicle())
if (auto player_vehicle = plyr->get_current_vehicle();
player_vehicle &&
(plyr->get_ped()->m_ped_task_flag & (uint32_t)ePedTask::TASK_DRIVING) &&
(player_vehicle->m_damage_bits & (uint32_t)eEntityProofs::GOD))
{
if (player_vehicle->m_damage_bits & (uint32_t)eEntityProofs::GOD)
mode_str = +"VEH_GOD";
mode_str =+ "Vehicle God";
}
if (!mode_str.empty())