summaryrefslogtreecommitdiffstats
path: root/src/peds
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2020-06-02 23:34:53 +0200
committeraap <aap@papnet.eu>2020-06-02 23:34:53 +0200
commit04a91761df7c90ed16b37407d65d8674033efd3f (patch)
treea5df11d9e0afee0c6ca376a214fd6cbdc65f58cf /src/peds
parentrenamed a vehicle thing (diff)
downloadre3-04a91761df7c90ed16b37407d65d8674033efd3f.tar
re3-04a91761df7c90ed16b37407d65d8674033efd3f.tar.gz
re3-04a91761df7c90ed16b37407d65d8674033efd3f.tar.bz2
re3-04a91761df7c90ed16b37407d65d8674033efd3f.tar.lz
re3-04a91761df7c90ed16b37407d65d8674033efd3f.tar.xz
re3-04a91761df7c90ed16b37407d65d8674033efd3f.tar.zst
re3-04a91761df7c90ed16b37407d65d8674033efd3f.zip
Diffstat (limited to 'src/peds')
-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 6b3b8686..055581ad 100644
--- a/src/peds/Ped.cpp
+++ b/src/peds/Ped.cpp
@@ -1682,11 +1682,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;
@@ -1698,11 +1694,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;
@@ -1712,11 +1704,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;
@@ -15031,11 +15019,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);
@@ -16817,29 +16801,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);