summaryrefslogtreecommitdiffstats
path: root/src/control/GameLogic.cpp
diff options
context:
space:
mode:
authorSergeanur <s.anureev@yandex.ua>2020-06-03 00:24:08 +0200
committerSergeanur <s.anureev@yandex.ua>2020-06-03 00:24:08 +0200
commit509ca11d76373671281f17c7f828a0187ed7b9e4 (patch)
treec3d072fd7933274fbfc9f85f6be4a09613b2e7be /src/control/GameLogic.cpp
parentsome CBike code; vehicle cleanup (diff)
parentsome vehicle cleanup (diff)
downloadre3-509ca11d76373671281f17c7f828a0187ed7b9e4.tar
re3-509ca11d76373671281f17c7f828a0187ed7b9e4.tar.gz
re3-509ca11d76373671281f17c7f828a0187ed7b9e4.tar.bz2
re3-509ca11d76373671281f17c7f828a0187ed7b9e4.tar.lz
re3-509ca11d76373671281f17c7f828a0187ed7b9e4.tar.xz
re3-509ca11d76373671281f17c7f828a0187ed7b9e4.tar.zst
re3-509ca11d76373671281f17c7f828a0187ed7b9e4.zip
Diffstat (limited to 'src/control/GameLogic.cpp')
-rw-r--r--src/control/GameLogic.cpp29
1 files changed, 27 insertions, 2 deletions
diff --git a/src/control/GameLogic.cpp b/src/control/GameLogic.cpp
index 6cfaa042..a98315e2 100644
--- a/src/control/GameLogic.cpp
+++ b/src/control/GameLogic.cpp
@@ -117,12 +117,20 @@ CGameLogic::Update()
}
break;
case WBSTATE_WASTED:
+#ifdef MISSION_REPLAY
+ if ((CTimer::GetTimeInMilliseconds() - pPlayerInfo.m_nWBTime > AddExtraDeathDelay() + 0x800) && (CTimer::GetPreviousTimeInMilliseconds() - pPlayerInfo.m_nWBTime <= AddExtraDeathDelay() + 0x800)) {
+#else
if ((CTimer::GetTimeInMilliseconds() - pPlayerInfo.m_nWBTime > 0x800) && (CTimer::GetPreviousTimeInMilliseconds() - pPlayerInfo.m_nWBTime <= 0x800)) {
+#endif
TheCamera.SetFadeColour(200, 200, 200);
TheCamera.Fade(2.0f, FADE_OUT);
}
+#ifdef MISSION_REPLAY
+ if (CTimer::GetTimeInMilliseconds() - pPlayerInfo.m_nWBTime >= AddExtraDeathDelay() + 0x1000) {
+#else
if (CTimer::GetTimeInMilliseconds() - pPlayerInfo.m_nWBTime >= 0x1000) {
+#endif
pPlayerInfo.m_WBState = WBSTATE_PLAYING;
if (pPlayerInfo.m_bGetOutOfHospitalFree) {
pPlayerInfo.m_bGetOutOfHospitalFree = false;
@@ -168,11 +176,16 @@ CGameLogic::Update()
}
break;
case WBSTATE_BUSTED:
+#ifdef MISSION_REPLAY
+ if ((CTimer::GetTimeInMilliseconds() - pPlayerInfo.m_nWBTime > AddExtraDeathDelay() + 0x800) && (CTimer::GetPreviousTimeInMilliseconds() - pPlayerInfo.m_nWBTime <= AddExtraDeathDelay() + 0x800)) {
+#else
if ((CTimer::GetTimeInMilliseconds() - pPlayerInfo.m_nWBTime > 0x800) && (CTimer::GetPreviousTimeInMilliseconds() - pPlayerInfo.m_nWBTime <= 0x800)) {
+#endif
TheCamera.SetFadeColour(0, 0, 0);
TheCamera.Fade(2.0f, FADE_OUT);
}
+
if (!CTheScripts::IsPlayerOnAMission() && pPlayerInfo.m_nBustedAudioStatus == 0) {
if (CGeneral::GetRandomNumberInRange(0, 4) == 0)
pPlayerInfo.m_nBustedAudioStatus = BUSTEDAUDIO_DONE;
@@ -191,8 +204,12 @@ CGameLogic::Update()
DMAudio.PlayLoadedMissionAudio(); // TODO: argument is 0
pPlayerInfo.m_nBustedAudioStatus = BUSTEDAUDIO_DONE;
}
-
+
+#ifdef MISSION_REPLAY
+ if (CTimer::GetTimeInMilliseconds() - pPlayerInfo.m_nWBTime >= AddExtraDeathDelay() + 0x1000) {
+#else
if (CTimer::GetTimeInMilliseconds() - pPlayerInfo.m_nWBTime >= 0x1000) {
+#endif
#ifdef FIX_BUGS
pPlayerInfo.m_nBustedAudioStatus = BUSTEDAUDIO_NONE;
#endif
@@ -266,11 +283,19 @@ CGameLogic::Update()
}
break;
case WBSTATE_FAILED_CRITICAL_MISSION:
- if (CTimer::GetTimeInMilliseconds() - pPlayerInfo.m_nWBTime > 0x800 && CTimer::GetPreviousTimeInMilliseconds() - pPlayerInfo.m_nWBTime <= 0x800) {
+#ifdef MISSION_REPLAY
+ if ((CTimer::GetTimeInMilliseconds() - pPlayerInfo.m_nWBTime > AddExtraDeathDelay() + 0x800) && (CTimer::GetPreviousTimeInMilliseconds() - pPlayerInfo.m_nWBTime <= AddExtraDeathDelay() + 0x800)) {
+#else
+ if ((CTimer::GetTimeInMilliseconds() - pPlayerInfo.m_nWBTime > 0x800) && (CTimer::GetPreviousTimeInMilliseconds() - pPlayerInfo.m_nWBTime <= 0x800)) {
+#endif
TheCamera.SetFadeColour(0, 0, 0);
TheCamera.Fade(2.0f, FADE_OUT);
}
+#ifdef MISSION_REPLAY
+ if (CTimer::GetTimeInMilliseconds() - pPlayerInfo.m_nWBTime >= AddExtraDeathDelay() + 0x1000) {
+#else
if (CTimer::GetTimeInMilliseconds() - pPlayerInfo.m_nWBTime >= 0x1000) {
+#endif
pPlayerInfo.m_WBState = WBSTATE_PLAYING;
if (pPlayerInfo.m_pPed->bInVehicle) {
CVehicle *pVehicle = pPlayerInfo.m_pPed->m_pMyVehicle;