Crash Fixes (?) (#3081)

This commit is contained in:
R.K 2024-05-09 14:09:59 -07:00 committed by GitHub
parent cbbcc65931
commit cee89f5e8a
2 changed files with 6 additions and 3 deletions

View File

@ -169,7 +169,7 @@ namespace big::entity
{ {
for (auto vehicle : pools::get_all_vehicles()) 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; continue;
target_entities.push_back(g_pointers->m_gta.m_ptr_to_handle(vehicle)); 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()) for (auto ped : pools::get_all_peds())
{ {
if (ped == g_local_player) if (!ped || ped == g_local_player)
continue; 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));
@ -191,6 +191,9 @@ namespace big::entity
{ {
for (auto prop : pools::get_all_props()) for (auto prop : pools::get_all_props())
{ {
if (!prop)
continue;
target_entities.push_back(g_pointers->m_gta.m_ptr_to_handle(prop)); target_entities.push_back(g_pointers->m_gta.m_ptr_to_handle(prop));
} }
} }

View File

@ -22,7 +22,7 @@ namespace big::notify
void crash_blocked(CNetGamePlayer* player, const char* crash) 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) 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) || g_player_service->get_by_id(player->m_player_id)->is_trusted || g.session.trust_session)