Skip to content

Commit

Permalink
Crash Fixes (?) (#3081)
Browse files Browse the repository at this point in the history
  • Loading branch information
rkwapisz committed May 9, 2024
1 parent 5065b44 commit 3d77d92
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/util/entity.cpp
Expand Up @@ -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));
Expand All @@ -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));
Expand All @@ -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));
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/util/notify.cpp
Expand Up @@ -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)
Expand Down

0 comments on commit 3d77d92

Please sign in to comment.