Advertisement
Guest User

Untitled

a guest
Dec 7th, 2013
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.37 KB | None | 0 0
  1. void __thiscall CVehicleAudio::UpdateAutomobileEngine(CVehicleAudio *this, TempVehicleAudioData *tempData)
  2. {
  3.   int i; // esi@1
  4.   CVehicleAudio *audio; // edi@1
  5.   char engineOff; // zf@1
  6.   double v5; // st7@5
  7.   double engineStatus; // st7@7
  8.   CMatrix v7; // [sp+8h] [bp-54h]@1
  9.   int _seh; // [sp+58h] [bp-4h]@1
  10.   float _engineStatus; // [sp+60h] [bp+4h]@10
  11.   float volume; // [sp+60h] [bp+4h]@10
  12.  
  13.   i = 0;
  14.   audio = this;
  15.   v7.m_pAttachMatrix = 0;                       // CMatrix v7;
  16.   v7.m_bAttachMatrixTemporary = 0;
  17.   engineOff = (tempData->m_pVehicle->vehicle.m_anVehicleFlags[0] & ENGINE_ON) == 0;
  18.   _seh = 0;
  19.   if ( engineOff )
  20.   {
  21.     do
  22.       CVehicleAudio::StopVehicleSound(audio, i++);
  23.     while ( (signed __int16)i < 12 );
  24.     goto @@return;
  25.   }
  26.   if ( !CAudioPlayer::IsBankInSlot(&g_AudioPlayer, 138u, 19) )
  27.     goto @@return;
  28.   v5 = *(float *)&tempData->m_pVehicle->m_sDamageManager.m_nEngineStatus * 4.5454545;
  29.   if ( v5 <= 1.0 )
  30.   {
  31.     if ( v5 < 0.2 )
  32.     {
  33.       engineStatus = 0.0;
  34.       goto LABEL_8;
  35.     }
  36.   }
  37.   else
  38.   {
  39.     v5 = 1.0;
  40.   }
  41.   engineStatus = (v5 - 0.2) * 1.25;
  42. LABEL_8:
  43.   if ( engineStatus <= 0.2 )
  44.     engineStatus = 0.2;
  45.   _engineStatus = engineStatus;
  46.   volume = sub_4D9E50(_engineStatus) * 20.0 + 8.0;
  47.   CVehicleAudio::AddSound(audio, 3, 19, 17, volume, 1.0);
  48. @@return:
  49.   _seh = -1;
  50.   CMatrix::_CMatrix(&v7);
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement