summaryrefslogtreecommitdiffstats
path: root/src/vehicles/Automobile.cpp
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/vehicles/Automobile.cpp
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 '')
-rw-r--r--src/vehicles/Automobile.cpp28
1 files changed, 20 insertions, 8 deletions
diff --git a/src/vehicles/Automobile.cpp b/src/vehicles/Automobile.cpp
index f35dd9e3..9aa5ae7c 100644
--- a/src/vehicles/Automobile.cpp
+++ b/src/vehicles/Automobile.cpp
@@ -145,8 +145,7 @@ CAutomobile::CAutomobile(int32 id, uint8 CreatedBy)
for(i = 0; i < 4; i++){
m_aGroundPhysical[i] = nil;
m_aGroundOffset[i] = CVector(0.0f, 0.0f, 0.0f);
- m_aSuspensionSpringRatio[i] = 1.0f;
- m_aSuspensionSpringRatioPrev[i] = m_aSuspensionSpringRatio[i];
+ m_aSuspensionSpringRatioPrev[i] = m_aSuspensionSpringRatio[i] = 1.0f;
m_aWheelTimer[i] = 0.0f;
m_aWheelRotation[i] = 0.0f;
m_aWheelSpeed[i] = 0.0f;
@@ -2314,6 +2313,17 @@ CAutomobile::ProcessControlInputs(uint8 pad)
m_fSteerAngle = DEGTORAD(pHandling->fSteeringLock) * fValue;
if(bComedyControls){
+#if 0 // old comedy controls from PS2 - same as bike's
+ if(((CTimer::GetTimeInMilliseconds() >> 10) & 0xF) < 12)
+ m_fGasPedal = 1.0f;
+ if((((CTimer::GetTimeInMilliseconds() >> 10)+6) & 0xF) < 12)
+ m_fBrakePedal = 0.0f;
+ bIsHandbrakeOn = false;
+ if(CTimer::GetTimeInMilliseconds() & 0x800)
+ m_fSteerAngle += 0.08f;
+ else
+ m_fSteerAngle -= 0.03f;
+#else
int rnd = CGeneral::GetRandomNumber() % 10;
switch(m_comedyControlState){
case 0:
@@ -2333,8 +2343,10 @@ CAutomobile::ProcessControlInputs(uint8 pad)
m_comedyControlState = 0;
break;
}
- }else
+ }else{
m_comedyControlState = 0;
+#endif
+ }
// Brake if player isn't in control
// BUG: game always uses pad 0 here
@@ -3948,8 +3960,8 @@ CAutomobile::BurstTyre(uint8 wheel)
CCarCtrl::SwitchVehicleToRealPhysics(this);
}
- ApplyMoveForce(GetRight() * CGeneral::GetRandomNumberInRange(-0.3f, 0.3f));
- ApplyTurnForce(GetRight() * CGeneral::GetRandomNumberInRange(-0.3f, 0.3f), GetForward());
+ ApplyMoveForce(GetRight() * m_fMass * CGeneral::GetRandomNumberInRange(-0.03f, 0.03f));
+ ApplyTurnForce(GetRight() * m_fTurnMass * CGeneral::GetRandomNumberInRange(-0.03f, 0.03f), GetForward());
}
}
@@ -3964,10 +3976,10 @@ CAutomobile::IsRoomForPedToLeaveCar(uint32 component, CVector *doorOffset)
CVector seatPos;
switch(component){
case CAR_DOOR_RF:
- seatPos = mi->m_positions[mi->m_vehicleType == VEHICLE_TYPE_BOAT ? BOAT_POS_FRONTSEAT : CAR_POS_FRONTSEAT];
+ seatPos = mi->GetFrontSeatPosn();
break;
case CAR_DOOR_LF:
- seatPos = mi->m_positions[mi->m_vehicleType == VEHICLE_TYPE_BOAT ? BOAT_POS_FRONTSEAT : CAR_POS_FRONTSEAT];
+ seatPos = mi->GetFrontSeatPosn();
seatPos.x = -seatPos.x;
break;
case CAR_DOOR_RR:
@@ -4558,7 +4570,7 @@ CAutomobile::SetupModelNodes(void)
int i;
for(i = 0; i < NUM_CAR_NODES; i++)
m_aCarNodes[i] = nil;
- CClumpModelInfo::FillFrameArray((RpClump*)m_rwObject, m_aCarNodes);
+ CClumpModelInfo::FillFrameArray(GetClump(), m_aCarNodes);
}
void