summaryrefslogtreecommitdiffstats
path: root/src/peds
diff options
context:
space:
mode:
authoreray orçunus <erayorcunus@gmail.com>2020-07-04 22:50:43 +0200
committereray orçunus <erayorcunus@gmail.com>2020-07-04 22:50:43 +0200
commitceb1defc4e220037ad1b17eb2b8a497c1385de7b (patch)
tree12b180ce323a9166a50bb4d028a0bdc27f31b76c /src/peds
parentMerge pull request #648 from Nick007J/miami (diff)
downloadre3-ceb1defc4e220037ad1b17eb2b8a497c1385de7b.tar
re3-ceb1defc4e220037ad1b17eb2b8a497c1385de7b.tar.gz
re3-ceb1defc4e220037ad1b17eb2b8a497c1385de7b.tar.bz2
re3-ceb1defc4e220037ad1b17eb2b8a497c1385de7b.tar.lz
re3-ceb1defc4e220037ad1b17eb2b8a497c1385de7b.tar.xz
re3-ceb1defc4e220037ad1b17eb2b8a497c1385de7b.tar.zst
re3-ceb1defc4e220037ad1b17eb2b8a497c1385de7b.zip
Diffstat (limited to 'src/peds')
-rw-r--r--src/peds/Ped.cpp34
1 files changed, 29 insertions, 5 deletions
diff --git a/src/peds/Ped.cpp b/src/peds/Ped.cpp
index a3672186..3c3fd46a 100644
--- a/src/peds/Ped.cpp
+++ b/src/peds/Ped.cpp
@@ -11356,19 +11356,34 @@ CPed::ProcessControl(void)
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;
- } else if (vehAnim == ANIM_CAR_QJACK) {
- if (m_pVehicleAnim->GetTimeLeft() > 0.69f && m_pVehicleAnim->GetTimeLeft() < 0.72f) {
- QuitEnteringCar();
- RestorePreviousObjective();
- }
+ 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;
}
@@ -12163,6 +12178,15 @@ CPed::PedAnimPullPedOutCB(CAnimBlendAssociation* animAssoc, void* arg)
if (!ped->IsNotInWreckedVehicle())
return;
+#ifdef CANCELLABLE_CAR_ENTER
+ if (ped->bCancelEnteringCar) {
+ ped->QuitEnteringCar();
+ ped->RestorePreviousObjective();
+ ped->bCancelEnteringCar = false;
+ return;
+ }
+#endif
+
bool isLow = !!veh->bLowVehicle;
int padNo;