summaryrefslogtreecommitdiffstats
path: root/src/audio/MusicManager.cpp
diff options
context:
space:
mode:
authorSergeanur <s.anureev@yandex.ua>2020-04-26 21:03:15 +0200
committerSergeanur <s.anureev@yandex.ua>2020-04-26 21:03:15 +0200
commitf0890b11122291a22d6a65f349281cf1aed49bd0 (patch)
tree3b418b522c5fd097abac916693e59808ea4f5b4f /src/audio/MusicManager.cpp
parentMore japanese (diff)
parentRemove little hack (diff)
downloadre3-f0890b11122291a22d6a65f349281cf1aed49bd0.tar
re3-f0890b11122291a22d6a65f349281cf1aed49bd0.tar.gz
re3-f0890b11122291a22d6a65f349281cf1aed49bd0.tar.bz2
re3-f0890b11122291a22d6a65f349281cf1aed49bd0.tar.lz
re3-f0890b11122291a22d6a65f349281cf1aed49bd0.tar.xz
re3-f0890b11122291a22d6a65f349281cf1aed49bd0.tar.zst
re3-f0890b11122291a22d6a65f349281cf1aed49bd0.zip
Diffstat (limited to '')
-rw-r--r--src/audio/MusicManager.cpp49
1 files changed, 12 insertions, 37 deletions
diff --git a/src/audio/MusicManager.cpp b/src/audio/MusicManager.cpp
index d840c57b..efea6e45 100644
--- a/src/audio/MusicManager.cpp
+++ b/src/audio/MusicManager.cpp
@@ -13,12 +13,12 @@
#include "Timer.h"
#include "World.h"
#include "sampman.h"
-#include "patcher.h"
-cMusicManager &MusicManager = *(cMusicManager *)0x8F3964;
-int32 &gNumRetunePresses = *(int32 *)0x650B80;
-int32 &gRetuneCounter = *(int32*)0x650B84;
-bool& bHasStarted = *(bool*)0x650B7C;
+
+cMusicManager MusicManager;
+int32 gNumRetunePresses;
+int32 gRetuneCounter;
+bool bHasStarted;
const int maxVolume = 127;
@@ -51,6 +51,12 @@ cMusicManager::PlayerInCar()
if(State == PED_DRAG_FROM_CAR || State == PED_EXIT_CAR || State == PED_ARRESTED)
return false;
+ if (!FindPlayerVehicle())
+ return true;
+
+ if (FindPlayerVehicle()->m_status == STATUS_WRECKED)
+ return false;
+
switch(FindPlayerVehicle()->m_modelIndex) {
case MI_FIRETRUCK:
case MI_AMBULAN:
@@ -699,7 +705,7 @@ cMusicManager::GetTrackStartPos(uint8 track)
result = m_aTracks[track].m_nPosition;
m_aTracks[track].m_nLastPosCheckTimer = CTimer::GetTimeInMillisecondsPauseMode();
} else
- result = min(CTimer::GetTimeInMillisecondsPauseMode() - timer, 90000) + m_aTracks[track].m_nPosition;
+ result = Min(CTimer::GetTimeInMillisecondsPauseMode() - timer, 90000) + m_aTracks[track].m_nPosition;
if (result > m_aTracks[track].m_nLength) result %= m_aTracks[track].m_nLength;
return result;
@@ -904,34 +910,3 @@ cMusicManager::ChangeRadioChannel()
}
return true;
}
-
-STARTPATCHES
-InjectHook(0x57E4B0, &cMusicManager::PlayerInCar, PATCH_JUMP);
-InjectHook(0x57E6D0, &cMusicManager::DisplayRadioStationName, PATCH_JUMP);
-InjectHook(0x57CF70, &cMusicManager::Initialise, PATCH_JUMP);
-InjectHook(0x57D140, &cMusicManager::Terminate, PATCH_JUMP);
-InjectHook(0x57D1D0, &cMusicManager::GetRadioInCar, PATCH_JUMP);
-InjectHook(0x57D2C0, &cMusicManager::SetRadioInCar, PATCH_JUMP);
-InjectHook(0x57D180, &cMusicManager::SetRadioChannelByScript, PATCH_JUMP);
-InjectHook(0x57CF30, &cMusicManager::ResetMusicAfterReload, PATCH_JUMP);
-InjectHook(0x57E6A0, &cMusicManager::UsesPoliceRadio, PATCH_JUMP);
-InjectHook(0x57D310, &cMusicManager::ChangeMusicMode, PATCH_JUMP);
-InjectHook(0x57D420, &cMusicManager::ResetTimers, PATCH_JUMP);
-InjectHook(0x57D440, &cMusicManager::Service, PATCH_JUMP);
-InjectHook(0x57D530, &cMusicManager::ServiceFrontEndMode, PATCH_JUMP);
-InjectHook(0x57E3D0, &cMusicManager::StopFrontEndTrack, PATCH_JUMP);
-InjectHook(0x57E430, &cMusicManager::PlayAnnouncement, PATCH_JUMP);
-InjectHook(0x57E2E0, &cMusicManager::PlayFrontEndTrack, PATCH_JUMP);
-InjectHook(0x57E210, &cMusicManager::PreloadCutSceneMusic, PATCH_JUMP);
-InjectHook(0x57E290, &cMusicManager::PlayPreloadedCutSceneMusic, PATCH_JUMP);
-InjectHook(0x57E2B0, &cMusicManager::StopCutSceneMusic, PATCH_JUMP);
-InjectHook(0x57E450, &cMusicManager::GetTrackStartPos, PATCH_JUMP);
-InjectHook(0x57D690, &cMusicManager::ServiceGameMode, PATCH_JUMP);
-InjectHook(0x57DCB0, &cMusicManager::ServiceAmbience, PATCH_JUMP);
-InjectHook(0x57DEA0, &cMusicManager::ComputeAmbienceVol, PATCH_JUMP);
-InjectHook(0x57E100, &cMusicManager::ServiceTrack, PATCH_JUMP);
-InjectHook(0x57DFC0, &cMusicManager::ServiceAnnouncement, PATCH_JUMP);
-InjectHook(0x57E530, &cMusicManager::GetCarTuning, PATCH_JUMP);
-InjectHook(0x57E5A0, &cMusicManager::GetNextCarTuning, PATCH_JUMP);
-InjectHook(0x57E130, &cMusicManager::ChangeRadioChannel, PATCH_JUMP);
-ENDPATCHES \ No newline at end of file