summaryrefslogtreecommitdiffstats
path: root/src/peds/Ped.cpp
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2020-06-02 23:35:20 +0200
committeraap <aap@papnet.eu>2020-06-02 23:35:20 +0200
commit2ca3c50463eff025b9783930d112dd0c257c040e (patch)
tree1601340bc1b3d51542aad6f448f52c89badfd89d /src/peds/Ped.cpp
parentfixed radar rendering (diff)
downloadre3-2ca3c50463eff025b9783930d112dd0c257c040e.tar
re3-2ca3c50463eff025b9783930d112dd0c257c040e.tar.gz
re3-2ca3c50463eff025b9783930d112dd0c257c040e.tar.bz2
re3-2ca3c50463eff025b9783930d112dd0c257c040e.tar.lz
re3-2ca3c50463eff025b9783930d112dd0c257c040e.tar.xz
re3-2ca3c50463eff025b9783930d112dd0c257c040e.tar.zst
re3-2ca3c50463eff025b9783930d112dd0c257c040e.zip
Diffstat (limited to '')
-rw-r--r--src/peds/Ped.cpp39
1 files changed, 7 insertions, 32 deletions
diff --git a/src/peds/Ped.cpp b/src/peds/Ped.cpp
index c2c272bf..72f9bfae 100644
--- a/src/peds/Ped.cpp
+++ b/src/peds/Ped.cpp
@@ -2059,11 +2059,7 @@ CPed::GetLocalPositionToOpenCarDoor(CVehicle *veh, uint32 component, float seatP
switch (component) {
case CAR_DOOR_RF:
- if (vehModel->m_vehicleType == VEHICLE_TYPE_BOAT)
- vehDoorPos = vehModel->m_positions[BOAT_POS_FRONTSEAT];
- else
- vehDoorPos = vehModel->m_positions[CAR_POS_FRONTSEAT];
-
+ vehDoorPos = vehModel->GetFrontSeatPosn();
vehDoorPos.x += seatOffset;
vehDoorOffset.x = -vehDoorOffset.x;
break;
@@ -2075,11 +2071,7 @@ CPed::GetLocalPositionToOpenCarDoor(CVehicle *veh, uint32 component, float seatP
break;
case CAR_DOOR_LF:
- if (vehModel->m_vehicleType == VEHICLE_TYPE_BOAT)
- vehDoorPos = vehModel->m_positions[BOAT_POS_FRONTSEAT];
- else
- vehDoorPos = vehModel->m_positions[CAR_POS_FRONTSEAT];
-
+ vehDoorPos = vehModel->GetFrontSeatPosn();
vehDoorPos.x = -(vehDoorPos.x + seatOffset);
break;
@@ -2089,11 +2081,7 @@ CPed::GetLocalPositionToOpenCarDoor(CVehicle *veh, uint32 component, float seatP
break;
default:
- if (vehModel->m_vehicleType == VEHICLE_TYPE_BOAT)
- vehDoorPos = vehModel->m_positions[BOAT_POS_FRONTSEAT];
- else
- vehDoorPos = vehModel->m_positions[CAR_POS_FRONTSEAT];
-
+ vehDoorPos = vehModel->GetFrontSeatPosn();
vehDoorOffset = CVector(0.0f, 0.0f, 0.0f);
}
return vehDoorPos - vehDoorOffset;
@@ -15678,11 +15666,7 @@ CPed::SeekBoatPosition(void)
CVehicleModelInfo *boatModel = m_carInObjective->GetModelInfo();
CVector enterOffset;
- if (boatModel->m_vehicleType == VEHICLE_TYPE_BOAT)
- enterOffset = boatModel->m_positions[BOAT_POS_FRONTSEAT];
- else
- enterOffset = boatModel->m_positions[CAR_POS_FRONTSEAT];
-
+ enterOffset = boatModel->GetFrontSeatPosn();
enterOffset.x = 0.0f;
CMatrix boatMat(m_carInObjective->GetMatrix());
SetMoveState(PEDMOVE_WALK);
@@ -17480,29 +17464,20 @@ CPed::SetPedPositionInCar(void)
CMatrix newMat(m_pMyVehicle->GetMatrix());
CVector seatPos;
if (m_pMyVehicle->pDriver == this) {
- if (vehModel->m_vehicleType == VEHICLE_TYPE_BOAT)
- seatPos = vehModel->m_positions[BOAT_POS_FRONTSEAT];
- else
- seatPos = vehModel->m_positions[CAR_POS_FRONTSEAT];
-
+ seatPos = vehModel->GetFrontSeatPosn();
if (!m_pMyVehicle->IsBoat() && m_pMyVehicle->m_vehType != VEHICLE_TYPE_BIKE)
seatPos.x = -seatPos.x;
} else if (m_pMyVehicle->pPassengers[0] == this) {
- if (vehModel->m_vehicleType == VEHICLE_TYPE_BOAT)
- seatPos = vehModel->m_positions[BOAT_POS_FRONTSEAT];
- else
- seatPos = vehModel->m_positions[CAR_POS_FRONTSEAT];
+ seatPos = vehModel->GetFrontSeatPosn();
} else if (m_pMyVehicle->pPassengers[1] == this) {
seatPos = vehModel->m_positions[CAR_POS_BACKSEAT];
seatPos.x = -seatPos.x;
} else {
if (m_pMyVehicle->pPassengers[2] == this) {
seatPos = vehModel->m_positions[CAR_POS_BACKSEAT];
- } else if (vehModel->m_vehicleType == VEHICLE_TYPE_BOAT) {
- seatPos = vehModel->m_positions[BOAT_POS_FRONTSEAT];
} else {
- seatPos = vehModel->m_positions[CAR_POS_FRONTSEAT];
+ seatPos = vehModel->GetFrontSeatPosn();
}
}
newMat.GetPosition() += Multiply3x3(newMat, seatPos);