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 464f2f90dc
commit 861ebdb2ae
4 changed files with 7 additions and 3 deletions

View File

@ -13,7 +13,7 @@ namespace big
{ {
for (auto ped : entity::get_entities(false, true)) 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); Vector3 my_location = ENTITY::GET_ENTITY_COORDS(self::ped, 1);
my_location.x = my_location.x + (rand() % 100 + (-50)); 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)) 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)) if (entity::take_control_of(vehicles, 0))
{ {

View File

@ -121,6 +121,9 @@ namespace big::entity
{ {
for (auto ped : pools::get_all_peds()) 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)); 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", [] { components::button<ImVec2(110, 0), ImVec4(0.76078f, 0.f, 0.03529f, 1.f)>("Kill Enemies", [] {
for (auto peds : entity::get_entities(false, true)) 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);
} }
}); });