More bug fixes (#1557)

Fixed nearby features affecting players and local ped.
Removed faulty vehicle kick protection from can_apply

Fixes #1540
This commit is contained in:
DayibBaba 2023-06-30 13:38:44 +02:00 committed by GitHub
parent f6969d88c5
commit c35c7fdff9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 7 additions and 7 deletions

View File

@ -13,7 +13,7 @@ namespace big
{
for (auto ped : entity::get_entities(false, true))
{
if (!ENTITY::IS_ENTITY_IN_AIR(ped) && entity::take_control_of(ped, 0))
if (!ENTITY::IS_ENTITY_IN_AIR(ped) && entity::take_control_of(ped, 0) && !PED::IS_PED_A_PLAYER(ped) && ped != self::ped)
{
Vector3 my_location = ENTITY::GET_ENTITY_COORDS(self::ped, 1);
my_location.x = my_location.x + (rand() % 100 + (-50));

View File

@ -14,7 +14,7 @@ namespace big
{
for (auto vehicles : entity::get_entities(true, false))
{
if (!ENTITY::IS_ENTITY_IN_AIR(vehicles))
if (!ENTITY::IS_ENTITY_IN_AIR(vehicles) && vehicles != self::veh)
{
if (entity::take_control_of(vehicles, 0))
{

View File

@ -773,10 +773,6 @@ namespace big
{
if (object && g_local_player && g_local_player->m_net_object)
{
if (is_in_vehicle(g_local_player, g_local_player->m_vehicle) && g_local_player->m_vehicle->m_net_object
&& g_local_player->m_vehicle->m_net_object->m_object_id == object->m_object_id)
return true; // vehicle kick?
if (!g_local_player->m_vehicle || !g_local_player->m_vehicle->m_net_object
|| g_local_player->m_vehicle->m_net_object->m_object_id != object->m_object_id
|| !is_in_vehicle(g_local_player, g_local_player->m_vehicle))

View File

@ -121,6 +121,9 @@ namespace big::entity
{
for (auto ped : pools::get_all_peds())
{
if(ped == g_local_player)
continue;
target_entities.push_back(g_pointers->m_gta.m_ptr_to_handle(ped));
}
}

View File

@ -28,7 +28,8 @@ namespace big
components::button<ImVec2(110, 0), ImVec4(0.76078f, 0.f, 0.03529f, 1.f)>("Kill Enemies", [] {
for (auto peds : entity::get_entities(false, true))
{
ped::kill_ped_by_relation(peds, 4 || 5);
if (!PED::IS_PED_A_PLAYER(peds))
ped::kill_ped_by_relation(peds, 4 || 5);
}
});