Car entering cancel test

This commit is contained in:
erorcun 2020-12-21 02:06:00 +03:00
parent 26aed6611e
commit 9b9545b92a

View file

@ -2583,39 +2583,15 @@ CPed::ProcessControl(void)
if (m_nWaitState != WAITSTATE_FALSE)
Wait();
switch (m_nPedState) {
case PED_IDLE:
Idle();
break;
case PED_LOOK_ENTITY:
case PED_LOOK_HEADING:
Look();
break;
case PED_WANDER_RANGE:
// III has these in here(and they were unused):
/*
WanderRange();
CheckAroundForPossibleCollisions();
*/
break;
case PED_WANDER_PATH:
WanderPath();
break;
case PED_ENTER_CAR:
case PED_CARJACK:
{
#ifdef CANCELLABLE_CAR_ENTER
if (!IsPlayer() || !m_pVehicleAnim)
break;
static bool cancelJack = false;
if (IsPlayer()) {
if (EnteringCar() && m_pVehicleAnim) {
CPad *pad = CPad::GetPad(0);
if (pad->ArePlayerControlsDisabled())
break;
if (!pad->ArePlayerControlsDisabled()) {
int vehAnim = m_pVehicleAnim->animId;
static bool cancelJack = false;
int16 padWalkX = pad->GetPedWalkLeftRight();
int16 padWalkY = pad->GetPedWalkUpDown();
if (Abs(padWalkX) > 0.0f || Abs(padWalkY) > 0.0f) {
@ -2643,7 +2619,33 @@ CPed::ProcessControl(void)
cancelJack = false;
bCancelEnteringCar = true;
}
}
} else
cancelJack = false;
}
#endif
switch (m_nPedState) {
case PED_IDLE:
Idle();
break;
case PED_LOOK_ENTITY:
case PED_LOOK_HEADING:
Look();
break;
case PED_WANDER_RANGE:
// III has these in here(and they were unused):
/*
WanderRange();
CheckAroundForPossibleCollisions();
*/
break;
case PED_WANDER_PATH:
WanderPath();
break;
case PED_ENTER_CAR:
case PED_CARJACK:
{
break;
}
case PED_FLEE_POS: