Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void __thiscall CVehicleAudio::UpdateAutomobileEngine(CVehicleAudio *this, TempVehicleAudioData *tempData)
- {
- int i; // esi@1
- CVehicleAudio *audio; // edi@1
- char engineOff; // zf@1
- double v5; // st7@5
- double engineStatus; // st7@7
- CMatrix v7; // [sp+8h] [bp-54h]@1
- int _seh; // [sp+58h] [bp-4h]@1
- float _engineStatus; // [sp+60h] [bp+4h]@10
- float volume; // [sp+60h] [bp+4h]@10
- i = 0;
- audio = this;
- v7.m_pAttachMatrix = 0; // CMatrix v7;
- v7.m_bAttachMatrixTemporary = 0;
- engineOff = (tempData->m_pVehicle->vehicle.m_anVehicleFlags[0] & ENGINE_ON) == 0;
- _seh = 0;
- if ( engineOff )
- {
- do
- CVehicleAudio::StopVehicleSound(audio, i++);
- while ( (signed __int16)i < 12 );
- goto @@return;
- }
- if ( !CAudioPlayer::IsBankInSlot(&g_AudioPlayer, 138u, 19) )
- goto @@return;
- v5 = *(float *)&tempData->m_pVehicle->m_sDamageManager.m_nEngineStatus * 4.5454545;
- if ( v5 <= 1.0 )
- {
- if ( v5 < 0.2 )
- {
- engineStatus = 0.0;
- goto LABEL_8;
- }
- }
- else
- {
- v5 = 1.0;
- }
- engineStatus = (v5 - 0.2) * 1.25;
- LABEL_8:
- if ( engineStatus <= 0.2 )
- engineStatus = 0.2;
- _engineStatus = engineStatus;
- volume = sub_4D9E50(_engineStatus) * 20.0 + 8.0;
- CVehicleAudio::AddSound(audio, 3, 19, 17, volume, 1.0);
- @@return:
- _seh = -1;
- CMatrix::_CMatrix(&v7);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement