summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/audio/AudioLogic.cpp7
-rw-r--r--src/audio/AudioManager.h10
2 files changed, 13 insertions, 4 deletions
diff --git a/src/audio/AudioLogic.cpp b/src/audio/AudioLogic.cpp
index 78174f33..94ca67de 100644
--- a/src/audio/AudioLogic.cpp
+++ b/src/audio/AudioLogic.cpp
@@ -579,14 +579,13 @@ cAudioManager::ProcessVehicle(CVehicle *veh)
m_sQueueSample.m_vecPos = veh->GetPosition();
params.m_bDistanceCalculated = false;
- params.m_fDistance = GetDistanceSquared(m_sQueueSample.m_vecPos);
params.m_pVehicle = veh;
- params.m_pTransmission = nil;
- params.m_nIndex = 0;
- params.m_fVelocityChange = 0.0f;
+ params.m_fDistance = GetDistanceSquared(m_sQueueSample.m_vecPos);
if (handling != nil)
params.m_pTransmission = &handling->Transmission;
+ else
+ params.m_pTransmission = nil;
params.m_nIndex = veh->GetModelIndex() - MI_FIRST_VEHICLE;
if (params.m_pVehicle->GetStatus() == STATUS_SIMPLE)
diff --git a/src/audio/AudioManager.h b/src/audio/AudioManager.h
index 7fdfecc2..e3d91876 100644
--- a/src/audio/AudioManager.h
+++ b/src/audio/AudioManager.h
@@ -150,6 +150,16 @@ public:
cTransmission *m_pTransmission;
int32 m_nIndex;
float m_fVelocityChange;
+
+ cVehicleParams()
+ {
+ m_bDistanceCalculated = false;
+ m_fDistance = 0.0f;
+ m_pVehicle = 0;
+ m_pTransmission = nil;
+ m_nIndex = 0;
+ m_fVelocityChange = 0.0f;
+ }
};
VALIDATE_SIZE(cVehicleParams, 0x18);