summaryrefslogtreecommitdiffstats
path: root/src/peds
diff options
context:
space:
mode:
authorerorcun <erorcunerorcun@hotmail.com.tr>2021-08-21 18:07:26 +0200
committererorcun <erorcunerorcun@hotmail.com.tr>2021-08-21 18:07:26 +0200
commitc52aebe8e7561c428c610e17827eb1347197369f (patch)
tree28faa3c8b6f8052b407b90c487fa3b54492c5fe5 /src/peds
parentFix map teleport Z coordinate (diff)
downloadre3-c52aebe8e7561c428c610e17827eb1347197369f.tar
re3-c52aebe8e7561c428c610e17827eb1347197369f.tar.gz
re3-c52aebe8e7561c428c610e17827eb1347197369f.tar.bz2
re3-c52aebe8e7561c428c610e17827eb1347197369f.tar.lz
re3-c52aebe8e7561c428c610e17827eb1347197369f.tar.xz
re3-c52aebe8e7561c428c610e17827eb1347197369f.tar.zst
re3-c52aebe8e7561c428c610e17827eb1347197369f.zip
Diffstat (limited to '')
-rw-r--r--src/peds/PedAI.cpp20
1 files changed, 8 insertions, 12 deletions
diff --git a/src/peds/PedAI.cpp b/src/peds/PedAI.cpp
index f1c753ec..8bd6791c 100644
--- a/src/peds/PedAI.cpp
+++ b/src/peds/PedAI.cpp
@@ -3531,23 +3531,17 @@ CPed::SetEnterCar_AllClear(CVehicle *car, uint32 doorNode, uint32 doorFlag)
m_vecOffsetSeek = doorOpenPos - GetPosition();
m_nPedStateTimer = CTimer::GetTimeInMilliseconds() + 600;
if (car->IsBoat()) {
-#ifdef VC_PED_PORTS
- // VC checks for handling flag, but we can't do that
- if(car->GetModelIndex() == MI_SPEEDER)
- m_pVehicleAnim = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_CAR_SIT, 100.0f);
- else
- m_pVehicleAnim = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_BOAT_DRIVE, 100.0f);
-
- PedSetInCarCB(nil, this);
- bVehExitWillBeInstant = true;
-#else
-
#ifndef FIX_BUGS
m_pVehicleAnim = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_BOAT_DRIVE, 100.0f);
#else
m_pVehicleAnim = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, car->GetDriverAnim(), 100.0f);
#endif
+ // Otherwise boat enter key sometimes processed multiple times, so you enter/exit instantly
+#if defined VC_PED_PORTS || defined FIX_BUGS
+ PedSetInCarCB(nil, this);
+ bVehExitWillBeInstant = true;
+#else
m_pVehicleAnim->SetFinishCallback(PedSetInCarCB, this);
#endif
if (IsPlayer())
@@ -5194,8 +5188,10 @@ CPed::SeekBoatPosition(void)
enterOffset = boatModel->GetFrontSeatPosn();
enterOffset.x = 0.0f;
CMatrix boatMat(m_carInObjective->GetMatrix());
+ CVector boatEnterPos = Multiply3x3(boatMat, enterOffset);
+ boatEnterPos += m_carInObjective->GetPosition();
SetMoveState(PEDMOVE_WALK);
- m_vecSeekPos = boatMat * enterOffset;
+ m_vecSeekPos = boatEnterPos;
if (Seek()) {
// We arrived to the boat
m_vehDoor = 0;