From 3d77d92db2a7ab5841a21f608e0588b9871c783c Mon Sep 17 00:00:00 2001 From: "R.K" Date: Thu, 9 May 2024 14:09:59 -0700 Subject: [PATCH] Crash Fixes (?) (#3081) --- src/util/entity.cpp | 7 +++++-- src/util/notify.cpp | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/util/entity.cpp b/src/util/entity.cpp index 8001c50a..1f9c017d 100644 --- a/src/util/entity.cpp +++ b/src/util/entity.cpp @@ -169,7 +169,7 @@ namespace big::entity { for (auto vehicle : pools::get_all_vehicles()) { - if (!include_self_veh && vehicle == gta_util::get_local_vehicle()) + if (!vehicle || (!include_self_veh && vehicle == gta_util::get_local_vehicle())) continue; target_entities.push_back(g_pointers->m_gta.m_ptr_to_handle(vehicle)); @@ -180,7 +180,7 @@ namespace big::entity { for (auto ped : pools::get_all_peds()) { - if (ped == g_local_player) + if (!ped || ped == g_local_player) continue; target_entities.push_back(g_pointers->m_gta.m_ptr_to_handle(ped)); @@ -191,6 +191,9 @@ namespace big::entity { for (auto prop : pools::get_all_props()) { + if (!prop) + continue; + target_entities.push_back(g_pointers->m_gta.m_ptr_to_handle(prop)); } } diff --git a/src/util/notify.cpp b/src/util/notify.cpp index 56a6f77a..5c2235cd 100644 --- a/src/util/notify.cpp +++ b/src/util/notify.cpp @@ -22,7 +22,7 @@ namespace big::notify void crash_blocked(CNetGamePlayer* player, const char* crash) { - if (player) + if (player && g_player_service->get_by_id(player->m_player_id)) { if ((g_player_service->get_by_id(player->m_player_id)->is_friend() && g.session.trust_friends) || g_player_service->get_by_id(player->m_player_id)->is_trusted || g.session.trust_session)