Added g_local_player pointer sanity checks. (#2792)
This commit is contained in:
@ -7,6 +7,9 @@ namespace big
|
||||
{
|
||||
void looped::vehicle_boost_behavior()
|
||||
{
|
||||
if (g_local_player == nullptr)
|
||||
return;
|
||||
|
||||
auto* const vehicle = g_local_player->m_vehicle;
|
||||
|
||||
bool is_rocket = VEHICLE::GET_HAS_ROCKET_BOOST(self::veh);
|
||||
|
@ -15,7 +15,7 @@ namespace big
|
||||
|
||||
virtual void on_tick() override
|
||||
{
|
||||
if (!self::veh || !g_local_player->m_vehicle || HUD::IS_PAUSE_MENU_ACTIVE() || HUD::IS_WARNING_MESSAGE_ACTIVE() || CAM::IS_SCREEN_FADED_OUT() || CAM::IS_SCREEN_FADING_OUT() || CAM::IS_SCREEN_FADING_IN())
|
||||
if (!self::veh || !g_local_player || !g_local_player->m_vehicle || HUD::IS_PAUSE_MENU_ACTIVE() || HUD::IS_WARNING_MESSAGE_ACTIVE() || CAM::IS_SCREEN_FADED_OUT() || CAM::IS_SCREEN_FADING_OUT() || CAM::IS_SCREEN_FADING_IN())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -108,11 +108,14 @@ namespace big
|
||||
|
||||
virtual void on_enable() override
|
||||
{
|
||||
reset(g_local_player->m_vehicle);
|
||||
if (g_local_player)
|
||||
reset(g_local_player->m_vehicle);
|
||||
}
|
||||
|
||||
virtual void on_tick() override
|
||||
{
|
||||
if (g_local_player == nullptr)
|
||||
return;
|
||||
const auto curr_veh = g_local_player->m_vehicle;
|
||||
if (curr_veh && !(g_local_player->m_ped_task_flag & (int)ePedTask::TASK_DRIVING))
|
||||
{
|
||||
|
Reference in New Issue
Block a user