mirror of
https://git.rip/DMCA_FUCKER/re3.git
synced 2024-11-05 13:55:54 +00:00
Car entering cancel test
This commit is contained in:
parent
26aed6611e
commit
9b9545b92a
|
@ -2583,6 +2583,48 @@ CPed::ProcessControl(void)
|
|||
if (m_nWaitState != WAITSTATE_FALSE)
|
||||
Wait();
|
||||
|
||||
#ifdef CANCELLABLE_CAR_ENTER
|
||||
static bool cancelJack = false;
|
||||
if (IsPlayer()) {
|
||||
if (EnteringCar() && m_pVehicleAnim) {
|
||||
CPad *pad = CPad::GetPad(0);
|
||||
|
||||
if (!pad->ArePlayerControlsDisabled()) {
|
||||
int vehAnim = m_pVehicleAnim->animId;
|
||||
|
||||
int16 padWalkX = pad->GetPedWalkLeftRight();
|
||||
int16 padWalkY = pad->GetPedWalkUpDown();
|
||||
if (Abs(padWalkX) > 0.0f || Abs(padWalkY) > 0.0f) {
|
||||
if (vehAnim == ANIM_CAR_OPEN_LHS || vehAnim == ANIM_CAR_OPEN_RHS || vehAnim == ANIM_COACH_OPEN_L || vehAnim == ANIM_COACH_OPEN_R ||
|
||||
vehAnim == ANIM_VAN_OPEN_L || vehAnim == ANIM_VAN_OPEN) {
|
||||
|
||||
if (!m_pMyVehicle->pDriver) {
|
||||
cancelJack = false;
|
||||
bCancelEnteringCar = true;
|
||||
} else
|
||||
cancelJack = true;
|
||||
} else if (vehAnim == ANIM_CAR_QJACK && m_pVehicleAnim->GetTimeLeft() > 0.75f) {
|
||||
cancelJack = true;
|
||||
} else if (vehAnim == ANIM_CAR_PULLOUT_LHS || vehAnim == ANIM_CAR_PULLOUT_LOW_LHS || vehAnim == ANIM_CAR_PULLOUT_LOW_RHS || vehAnim == ANIM_CAR_PULLOUT_RHS) {
|
||||
bCancelEnteringCar = true;
|
||||
cancelJack = false;
|
||||
}
|
||||
}
|
||||
if (cancelJack && vehAnim == ANIM_CAR_QJACK && m_pVehicleAnim->GetTimeLeft() > 0.75f && m_pVehicleAnim->GetTimeLeft() < 0.78f) {
|
||||
cancelJack = false;
|
||||
QuitEnteringCar();
|
||||
RestorePreviousObjective();
|
||||
}
|
||||
if (cancelJack && (vehAnim == ANIM_CAR_PULLOUT_LHS || vehAnim == ANIM_CAR_PULLOUT_LOW_LHS || vehAnim == ANIM_CAR_PULLOUT_LOW_RHS || vehAnim == ANIM_CAR_PULLOUT_RHS)) {
|
||||
cancelJack = false;
|
||||
bCancelEnteringCar = true;
|
||||
}
|
||||
}
|
||||
} else
|
||||
cancelJack = false;
|
||||
}
|
||||
#endif
|
||||
|
||||
switch (m_nPedState) {
|
||||
case PED_IDLE:
|
||||
Idle();
|
||||
|
@ -2604,46 +2646,6 @@ CPed::ProcessControl(void)
|
|||
case PED_ENTER_CAR:
|
||||
case PED_CARJACK:
|
||||
{
|
||||
#ifdef CANCELLABLE_CAR_ENTER
|
||||
if (!IsPlayer() || !m_pVehicleAnim)
|
||||
break;
|
||||
|
||||
CPad *pad = CPad::GetPad(0);
|
||||
|
||||
if (pad->ArePlayerControlsDisabled())
|
||||
break;
|
||||
|
||||
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) {
|
||||
if (vehAnim == ANIM_CAR_OPEN_LHS || vehAnim == ANIM_CAR_OPEN_RHS || vehAnim == ANIM_COACH_OPEN_L || vehAnim == ANIM_COACH_OPEN_R ||
|
||||
vehAnim == ANIM_VAN_OPEN_L || vehAnim == ANIM_VAN_OPEN) {
|
||||
|
||||
if (!m_pMyVehicle->pDriver) {
|
||||
cancelJack = false;
|
||||
bCancelEnteringCar = true;
|
||||
} else
|
||||
cancelJack = true;
|
||||
} else if (vehAnim == ANIM_CAR_QJACK && m_pVehicleAnim->GetTimeLeft() > 0.75f) {
|
||||
cancelJack = true;
|
||||
} else if (vehAnim == ANIM_CAR_PULLOUT_LHS || vehAnim == ANIM_CAR_PULLOUT_LOW_LHS || vehAnim == ANIM_CAR_PULLOUT_LOW_RHS || vehAnim == ANIM_CAR_PULLOUT_RHS) {
|
||||
bCancelEnteringCar = true;
|
||||
cancelJack = false;
|
||||
}
|
||||
}
|
||||
if (cancelJack && vehAnim == ANIM_CAR_QJACK && m_pVehicleAnim->GetTimeLeft() > 0.75f && m_pVehicleAnim->GetTimeLeft() < 0.78f) {
|
||||
cancelJack = false;
|
||||
QuitEnteringCar();
|
||||
RestorePreviousObjective();
|
||||
}
|
||||
if (cancelJack && (vehAnim == ANIM_CAR_PULLOUT_LHS || vehAnim == ANIM_CAR_PULLOUT_LOW_LHS || vehAnim == ANIM_CAR_PULLOUT_LOW_RHS || vehAnim == ANIM_CAR_PULLOUT_RHS)) {
|
||||
cancelJack = false;
|
||||
bCancelEnteringCar = true;
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
case PED_FLEE_POS:
|
||||
|
|
Loading…
Reference in a new issue