summaryrefslogtreecommitdiffstats
path: root/src/peds/PedAI.cpp
diff options
context:
space:
mode:
authorSergeanur <s.anureev@yandex.ua>2021-01-24 21:22:16 +0100
committerSergeanur <s.anureev@yandex.ua>2021-01-24 21:22:16 +0100
commit0ad1426950148f44d8e595a703787254d45b956f (patch)
treef819475b9ab496f437a1f7359e4d3fa2db2afb11 /src/peds/PedAI.cpp
parentMerge pull request #987 from Sergeanur/lcsHud (diff)
parentPed: car enter anim. fix (diff)
downloadre3-0ad1426950148f44d8e595a703787254d45b956f.tar
re3-0ad1426950148f44d8e595a703787254d45b956f.tar.gz
re3-0ad1426950148f44d8e595a703787254d45b956f.tar.bz2
re3-0ad1426950148f44d8e595a703787254d45b956f.tar.lz
re3-0ad1426950148f44d8e595a703787254d45b956f.tar.xz
re3-0ad1426950148f44d8e595a703787254d45b956f.tar.zst
re3-0ad1426950148f44d8e595a703787254d45b956f.zip
Diffstat (limited to 'src/peds/PedAI.cpp')
-rw-r--r--src/peds/PedAI.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/peds/PedAI.cpp b/src/peds/PedAI.cpp
index d0f155c5..105cdbef 100644
--- a/src/peds/PedAI.cpp
+++ b/src/peds/PedAI.cpp
@@ -3342,6 +3342,7 @@ void
CPed::LineUpPedWithCar(PedLineUpPhase phase)
{
bool vehIsUpsideDown = false;
+ bool stillGettingInOut = false;
int vehAnim;
float seatPosMult = 0.0f;
float currentZ;
@@ -3594,8 +3595,8 @@ CPed::LineUpPedWithCar(PedLineUpPhase phase)
if (m_pVehicleAnim && vehAnim != ANIM_VAN_GETIN_L && vehAnim != ANIM_VAN_CLOSE_L && vehAnim != ANIM_VAN_CLOSE && vehAnim != ANIM_VAN_GETIN) {
neededPos.z = autoZPos.z;
m_vecMoveSpeed = CVector(0.0f, 0.0f, 0.0f);
- } else if (neededPos.z <= currentZ && m_pVehicleAnim && vehAnim != ANIM_VAN_CLOSE_L && vehAnim != ANIM_VAN_CLOSE) {
- adjustedTimeStep = Min(m_pVehicleAnim->timeStep, 0.1f);
+ } else if (neededPos.z < currentZ && m_pVehicleAnim && vehAnim != ANIM_VAN_CLOSE_L && vehAnim != ANIM_VAN_CLOSE) {
+ adjustedTimeStep = Max(m_pVehicleAnim->timeStep, 0.1f);
// Smoothly change ped position
neededPos.z = currentZ - (currentZ - neededPos.z) / (m_pVehicleAnim->GetTimeLeft() / adjustedTimeStep);
@@ -3613,7 +3614,7 @@ CPed::LineUpPedWithCar(PedLineUpPhase phase)
if (m_pVehicleAnim &&
(vehAnim == ANIM_CAR_GETIN_RHS || vehAnim == ANIM_CAR_GETIN_LOW_RHS || vehAnim == ANIM_CAR_GETIN_LHS || vehAnim == ANIM_CAR_GETIN_LOW_LHS
|| vehAnim == ANIM_CAR_QJACK || vehAnim == ANIM_VAN_GETIN_L || vehAnim == ANIM_VAN_GETIN)) {
- adjustedTimeStep = Min(m_pVehicleAnim->timeStep, 0.1f);
+ adjustedTimeStep = Max(m_pVehicleAnim->timeStep, 0.1f);
// Smoothly change ped position
neededPos.z = (neededPos.z - currentZ) / (m_pVehicleAnim->GetTimeLeft() / adjustedTimeStep) + currentZ;
@@ -3625,7 +3626,6 @@ CPed::LineUpPedWithCar(PedLineUpPhase phase)
}
}
- bool stillGettingInOut = false;
if (CTimer::GetTimeInMilliseconds() < m_nPedStateTimer)
stillGettingInOut = veh->m_vehType != VEHICLE_TYPE_BOAT || bOnBoat;