Fixed aimbot trying to aim at peds inside our current vehicle. (#3443)

This commit is contained in:
gir489 2024-07-26 17:10:22 -04:00 committed by GitHub
parent 519c1305de
commit 187ac86535
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 3 deletions

View File

@ -144,8 +144,9 @@ namespace big
continue;
}
const auto is_not_a_player_and_we_target_only_players = g_aimbot_only_on_player.is_enabled() && !ped->m_player_info;
if (is_not_a_player_and_we_target_only_players)
const bool is_not_a_player_and_we_target_only_players = g_aimbot_only_on_player.is_enabled() && !ped->m_player_info;
const bool we_in_the_same_vehicle = self::veh != 0 && ped->m_vehicle == g_player_service->get_self()->get_current_vehicle();
if (is_not_a_player_and_we_target_only_players || we_in_the_same_vehicle)
{
continue;
}

View File

@ -30,8 +30,12 @@ namespace big
if (ped_ptr == nullptr)
return;
if (g.weapons.aimbot.only_on_player && !ped_ptr->m_player_info)
const bool trace_hit_non_player = g.weapons.aimbot.only_on_player && !ped_ptr->m_player_info;
const bool we_in_the_same_vehicle = self::veh != 0 && ped_ptr->m_vehicle == g_player_service->get_self()->get_current_vehicle();
if (trace_hit_non_player || we_in_the_same_vehicle)
{
return;
}
if (g.weapons.aimbot.exclude_friends && ped_ptr->m_player_info)
{