fix(Handling): Updated vehicle pointer continiously

Waiting for the entity id to change had bad results
This commit is contained in:
Yimura 2021-02-19 15:41:10 +01:00
parent 50bf9f1b2b
commit 1efaa78a36
No known key found for this signature in database
GPG Key ID: 3D8FF4397E768682

View File

@ -4,7 +4,7 @@
namespace big
{
static Vehicle veh = -1;
//static Vehicle veh = -1;
void vehicle::handling()
{
@ -13,16 +13,8 @@ namespace big
g_temp.in_vehicle = ped->m_in_vehicle == 0;
if (g_temp.in_vehicle)
{
Vehicle currVeh = PED::GET_VEHICLE_PED_IS_IN(PLAYER::PLAYER_PED_ID(), false);
if (veh != currVeh && ped->m_vehicle != nullptr)
{
veh = currVeh;
// Copy the new vehicle data to our global
g_vehicle = ped->m_vehicle;
}
}
else g_vehicle = nullptr;
else
g_vehicle = nullptr;
}
}