summaryrefslogtreecommitdiffstats
path: root/src/vehicles/Automobile.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/vehicles/Automobile.cpp')
-rw-r--r--src/vehicles/Automobile.cpp27
1 files changed, 18 insertions, 9 deletions
diff --git a/src/vehicles/Automobile.cpp b/src/vehicles/Automobile.cpp
index 4863b945..3de3e12b 100644
--- a/src/vehicles/Automobile.cpp
+++ b/src/vehicles/Automobile.cpp
@@ -45,6 +45,7 @@
#include "Object.h"
#include "Automobile.h"
#include "Wanted.h"
+#include "SaveBuf.h"
bool bAllCarCheat; // unused
@@ -333,7 +334,11 @@ CAutomobile::ProcessControl(void)
bool playerRemote = false;
switch(GetStatus()){
case STATUS_PLAYER_REMOTE:
- if(CPad::GetPad(0)->WeaponJustDown()){
+#ifdef FIX_BUGS
+ if (CPad::GetPad(0)->CarGunJustDown()) {
+#else
+ if (CPad::GetPad(0)->WeaponJustDown()) {
+#endif
BlowUpCar(FindPlayerPed());
CRemote::TakeRemoteControlledCarFromPlayer();
}
@@ -1660,7 +1665,7 @@ CAutomobile::PreRender(void)
// 1.0 if directly behind car, -1.0 if in front
// BUG on PC: Abs of DotProduct is taken
float behindness = DotProduct(lookVector, GetForward());
- behindness = clamp(behindness, -1.0f, 1.0f); // shouldn't be necessary
+ behindness = Clamp(behindness, -1.0f, 1.0f); // shouldn't be necessary
// 0.0 if behind car, PI if in front
// Abs not necessary
float angle = Abs(Acos(behindness));
@@ -2259,7 +2264,7 @@ CAutomobile::ProcessControlInputs(uint8 pad)
0.2f*CTimer::GetTimeStep();
nLastControlInput = 0;
}
- m_fSteerInput = clamp(m_fSteerInput, -1.0f, 1.0f);
+ m_fSteerInput = Clamp(m_fSteerInput, -1.0f, 1.0f);
// Accelerate/Brake
float acceleration = (CPad::GetPad(pad)->GetAccelerate() - CPad::GetPad(pad)->GetBrake())/255.0f;
@@ -2372,7 +2377,11 @@ void
CAutomobile::FireTruckControl(void)
{
if(this == FindPlayerVehicle()){
- if(!CPad::GetPad(0)->GetWeapon())
+#ifdef FIX_BUGS
+ if (!CPad::GetPad(0)->GetCarGunFired())
+#else
+ if (!CPad::GetPad(0)->GetWeapon())
+#endif // FIX_BUGS
return;
#ifdef FREE_CAM
if (!CCamera::bFreeCam)
@@ -2381,7 +2390,7 @@ CAutomobile::FireTruckControl(void)
m_fCarGunLR += CPad::GetPad(0)->GetCarGunLeftRight() * 0.00025f * CTimer::GetTimeStep();
m_fCarGunUD += CPad::GetPad(0)->GetCarGunUpDown() * 0.0001f * CTimer::GetTimeStep();
}
- m_fCarGunUD = clamp(m_fCarGunUD, 0.05f, 0.3f);
+ m_fCarGunUD = Clamp(m_fCarGunUD, 0.05f, 0.3f);
CVector cannonPos(0.0f, 1.5f, 1.9f);
@@ -2826,7 +2835,7 @@ CAutomobile::HydraulicControl(void)
float limitDiff = extendedLowerLimit - normalLowerLimit;
if(limitDiff != 0.0f && Abs(maxDelta/limitDiff) > 0.01f){
float f = (maxDelta + limitDiff)/2.0f/limitDiff;
- f = clamp(f, 0.0f, 1.0f);
+ f = Clamp(f, 0.0f, 1.0f);
DMAudio.PlayOneShot(m_audioEntityId, SOUND_CAR_HYDRAULIC_3, f);
if(f < 0.4f || f > 0.6f)
setPrevRatio = true;
@@ -3054,7 +3063,7 @@ CAutomobile::DoDriveByShootings(void)
lookingLeft = true;
if(TheCamera.Cams[TheCamera.ActiveCam].LookingRight)
lookingRight = true;
- }
+ }
if(lookingLeft || lookingRight){
if(lookingLeft){
@@ -4042,7 +4051,7 @@ CAutomobile::GetHeightAboveRoad(void)
void
CAutomobile::PlayCarHorn(void)
{
- int r;
+ uint32 r;
if(m_nCarHornTimer != 0)
return;
@@ -4716,7 +4725,7 @@ void
CAutomobile::Load(uint8*& buf)
{
CVehicle::Load(buf);
- Damage = ReadSaveBuf<CDamageManager>(buf);
+ ReadSaveBuf(&Damage, buf);
SkipSaveBuf(buf, 800 - sizeof(CDamageManager));
SetupDamageAfterLoad();
}