summaryrefslogtreecommitdiffstats
path: root/src/vehicles/Automobile.cpp
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2020-03-31 10:29:35 +0200
committerGitHub <noreply@github.com>2020-03-31 10:29:35 +0200
commita57d9b6797841db38f14b63e224da2d00d8f38fc (patch)
tree619bc010a0a290810fcc96b79b3a4071da1bb9cb /src/vehicles/Automobile.cpp
parentMerge pull request #371 from Sergeanur/MoreLanguages (diff)
parentMouse free cam for peds&cars (under FREE_CAM) (diff)
downloadre3-a57d9b6797841db38f14b63e224da2d00d8f38fc.tar
re3-a57d9b6797841db38f14b63e224da2d00d8f38fc.tar.gz
re3-a57d9b6797841db38f14b63e224da2d00d8f38fc.tar.bz2
re3-a57d9b6797841db38f14b63e224da2d00d8f38fc.tar.lz
re3-a57d9b6797841db38f14b63e224da2d00d8f38fc.tar.xz
re3-a57d9b6797841db38f14b63e224da2d00d8f38fc.tar.zst
re3-a57d9b6797841db38f14b63e224da2d00d8f38fc.zip
Diffstat (limited to 'src/vehicles/Automobile.cpp')
-rw-r--r--src/vehicles/Automobile.cpp18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/vehicles/Automobile.cpp b/src/vehicles/Automobile.cpp
index e709a87f..aca96aa3 100644
--- a/src/vehicles/Automobile.cpp
+++ b/src/vehicles/Automobile.cpp
@@ -2339,10 +2339,17 @@ CAutomobile::FireTruckControl(void)
if(this == FindPlayerVehicle()){
if(!CPad::GetPad(0)->GetWeapon())
return;
- m_fCarGunLR += CPad::GetPad(0)->GetCarGunLeftRight()*0.00025f*CTimer::GetTimeStep();
- m_fCarGunUD += CPad::GetPad(0)->GetCarGunUpDown()*0.0001f*CTimer::GetTimeStep();
+#ifdef FREE_CAM
+ extern bool bFreeMouseCam;
+ if (!bFreeMouseCam)
+#endif
+ {
+ 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);
+
CVector cannonPos(0.0f, 1.5f, 1.9f);
cannonPos = GetMatrix() * cannonPos;
CVector cannonDir(
@@ -2408,7 +2415,12 @@ CAutomobile::TankControl(void)
// Rotate turret
float prevAngle = m_fCarGunLR;
- m_fCarGunLR -= CPad::GetPad(0)->GetCarGunLeftRight() * 0.00015f * CTimer::GetTimeStep();
+#ifdef FREE_CAM
+ extern bool bFreeMouseCam;
+ if(!bFreeMouseCam)
+#endif
+ m_fCarGunLR -= CPad::GetPad(0)->GetCarGunLeftRight() * 0.00015f * CTimer::GetTimeStep();
+
if(m_fCarGunLR < 0.0f)
m_fCarGunLR += TWOPI;
if(m_fCarGunLR > TWOPI)