mirror of
https://github.com/s1lentq/ReGameDLL_CS.git
synced 2024-12-28 15:45:41 +03:00
Ensure m_pDriver assignation on func_vehicle only (#853)
This commit is contained in:
parent
f441279294
commit
2e6e77906f
@ -4107,11 +4107,10 @@ void CBasePlayer::PlayerUse()
|
|||||||
if (pTrain && pTrain->Classify() == CLASS_VEHICLE)
|
if (pTrain && pTrain->Classify() == CLASS_VEHICLE)
|
||||||
{
|
{
|
||||||
#ifdef REGAMEDLL_ADD
|
#ifdef REGAMEDLL_ADD
|
||||||
if (legacy_vehicle_block.value)
|
if (legacy_vehicle_block.value == 0)
|
||||||
((CFuncVehicle *)pTrain)->m_pDriver = nullptr;
|
return;
|
||||||
#else
|
|
||||||
((CFuncVehicle *)pTrain)->m_pDriver = nullptr;
|
|
||||||
#endif
|
#endif
|
||||||
|
((CFuncVehicle *)pTrain)->m_pDriver = nullptr;
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -4653,12 +4652,17 @@ void EXT_FUNC CBasePlayer::__API_HOOK(PreThink)()
|
|||||||
{
|
{
|
||||||
m_afPhysicsFlags &= ~PFLAG_ONTRAIN;
|
m_afPhysicsFlags &= ~PFLAG_ONTRAIN;
|
||||||
m_iTrain = (TRAIN_NEW | TRAIN_OFF);
|
m_iTrain = (TRAIN_NEW | TRAIN_OFF);
|
||||||
#ifdef REGAMEDLL_ADD
|
|
||||||
if (legacy_vehicle_block.value)
|
#ifdef REGAMEDLL_FIXES
|
||||||
((CFuncVehicle *)pTrain)->m_pDriver = nullptr;
|
if (pTrain && pTrain->Classify() == CLASS_VEHICLE) // ensure func_vehicle's m_pDriver assignation
|
||||||
#else
|
|
||||||
((CFuncVehicle *)pTrain)->m_pDriver = nullptr;
|
|
||||||
#endif
|
#endif
|
||||||
|
{
|
||||||
|
#ifdef REGAMEDLL_ADD
|
||||||
|
if (legacy_vehicle_block.value == 0)
|
||||||
|
return;
|
||||||
|
#endif
|
||||||
|
((CFuncVehicle *)pTrain)->m_pDriver = nullptr;
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -4667,12 +4671,17 @@ void EXT_FUNC CBasePlayer::__API_HOOK(PreThink)()
|
|||||||
// Turn off the train if you jump, strafe, or the train controls go dead
|
// Turn off the train if you jump, strafe, or the train controls go dead
|
||||||
m_afPhysicsFlags &= ~PFLAG_ONTRAIN;
|
m_afPhysicsFlags &= ~PFLAG_ONTRAIN;
|
||||||
m_iTrain = (TRAIN_NEW | TRAIN_OFF);
|
m_iTrain = (TRAIN_NEW | TRAIN_OFF);
|
||||||
#ifdef REGAMEDLL_ADD
|
|
||||||
if (legacy_vehicle_block.value)
|
#ifdef REGAMEDLL_FIXES
|
||||||
((CFuncVehicle *)pTrain)->m_pDriver = nullptr;
|
if (pTrain->Classify() == CLASS_VEHICLE) // ensure func_vehicle's m_pDriver assignation
|
||||||
#else
|
|
||||||
((CFuncVehicle *)pTrain)->m_pDriver = nullptr;
|
|
||||||
#endif
|
#endif
|
||||||
|
{
|
||||||
|
#ifdef REGAMEDLL_ADD
|
||||||
|
if (legacy_vehicle_block.value == 0)
|
||||||
|
return;
|
||||||
|
#endif
|
||||||
|
((CFuncVehicle *)pTrain)->m_pDriver = nullptr;
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user