Fixed vehicle repaired/vehicle godmode code not running if the player was offline/did not have a personal vehicle deployed.

This commit is contained in:
gir489returns 2024-08-16 23:34:38 -04:00
parent c59a0ff948
commit 0217c5e281
2 changed files with 8 additions and 4 deletions

View File

@ -18,10 +18,13 @@ namespace big
return; return;
} }
if (*g_pointers->m_gta.m_is_session_started)
{
if (!entity::take_control_of(veh, 0)) if (!entity::take_control_of(veh, 0))
{ {
return; return;
} }
}
if (VEHICLE::GET_DOES_VEHICLE_HAVE_DAMAGE_DECALS(veh)) if (VEHICLE::GET_DOES_VEHICLE_HAVE_DAMAGE_DECALS(veh))
{ {

View File

@ -95,11 +95,12 @@ namespace big
{ {
if (g_local_player) if (g_local_player)
{ {
if (const auto personal_vehicle = mobile::mechanic::get_personal_cvehicle()) const auto personal_vehicle = mobile::mechanic::get_personal_cvehicle();
if (personal_vehicle)
{ {
apply_godmode_to_vehicle(personal_vehicle, true); apply_godmode_to_vehicle(personal_vehicle, true);
apply_godmode_to_vehicle(g_local_player->m_vehicle, personal_vehicle == g_local_player->m_vehicle);
} }
apply_godmode_to_vehicle(g_local_player->m_vehicle, personal_vehicle == g_local_player->m_vehicle);
} }
} }