From ca65c764197bcd065f101cdf7da7c48b286c8208 Mon Sep 17 00:00:00 2001 From: Nikolay Korolev Date: Wed, 3 Feb 2021 15:35:06 +0300 Subject: fix --- src/control/AutoPilot.cpp | 8 ++++---- src/control/AutoPilot.h | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/control/AutoPilot.cpp b/src/control/AutoPilot.cpp index c956a6f1..d3de6ac2 100644 --- a/src/control/AutoPilot.cpp +++ b/src/control/AutoPilot.cpp @@ -52,8 +52,8 @@ void CAutoPilot::Save(uint8*& buf) WriteSaveBuf(buf, m_nCurrentRouteNode); WriteSaveBuf(buf, m_nNextRouteNode); WriteSaveBuf(buf, m_nPrevRouteNode); - WriteSaveBuf(buf, m_nTimeEnteredCurve); - WriteSaveBuf(buf, m_nTimeToSpendOnCurrentCurve); + WriteSaveBuf(buf, m_nTimeEnteredCurve); + WriteSaveBuf(buf, m_nTimeToSpendOnCurrentCurve); WriteSaveBuf(buf, m_nCurrentPathNodeInfo); WriteSaveBuf(buf, m_nNextPathNodeInfo); WriteSaveBuf(buf, m_nPreviousPathNodeInfo); @@ -95,8 +95,8 @@ void CAutoPilot::Load(uint8*& buf) m_nCurrentRouteNode = ReadSaveBuf(buf); m_nNextRouteNode = ReadSaveBuf(buf); m_nPrevRouteNode = ReadSaveBuf(buf); - m_nTimeEnteredCurve = ReadSaveBuf(buf); - m_nTimeToSpendOnCurrentCurve = ReadSaveBuf(buf); + m_nTimeEnteredCurve = ReadSaveBuf(buf); + m_nTimeToSpendOnCurrentCurve = ReadSaveBuf(buf); m_nCurrentPathNodeInfo = ReadSaveBuf(buf); m_nNextPathNodeInfo = ReadSaveBuf(buf); m_nPreviousPathNodeInfo = ReadSaveBuf(buf); diff --git a/src/control/AutoPilot.h b/src/control/AutoPilot.h index aa14ccdd..ec3bb8d8 100644 --- a/src/control/AutoPilot.h +++ b/src/control/AutoPilot.h @@ -64,8 +64,8 @@ public: int32 m_nCurrentRouteNode; int32 m_nNextRouteNode; int32 m_nPrevRouteNode; - uint32 m_nTimeEnteredCurve; - uint32 m_nTimeToSpendOnCurrentCurve; + int32 m_nTimeEnteredCurve; + int32 m_nTimeToSpendOnCurrentCurve; uint32 m_nCurrentPathNodeInfo; uint32 m_nNextPathNodeInfo; uint32 m_nPreviousPathNodeInfo; -- cgit v1.2.3 From ca48ebcb6e22b17e217afc8661c572f83827b83d Mon Sep 17 00:00:00 2001 From: erorcun Date: Wed, 3 Feb 2021 23:03:00 +0300 Subject: MP3 player fixes --- src/audio/sampman_oal.cpp | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/audio/sampman_oal.cpp b/src/audio/sampman_oal.cpp index 2091fb05..ae4b1cbb 100644 --- a/src/audio/sampman_oal.cpp +++ b/src/audio/sampman_oal.cpp @@ -1908,6 +1908,9 @@ cSampleManager::StopStreamedFile(uint8 nStream) { delete stream; aStream[nStream] = NULL; + + if ( nStream == 0 ) + _bIsMp3Active = false; } } @@ -1920,7 +1923,21 @@ cSampleManager::GetStreamedFilePosition(uint8 nStream) if ( stream ) { - return stream->GetPosMS(); + if ( _bIsMp3Active ) + { + tMP3Entry *mp3 = _GetMP3EntryByIndex(_CurMP3Index); + + if ( mp3 != NULL ) + { + return stream->GetPosMS() + mp3->nTrackStreamPos; + } + else + return 0; + } + else + { + return stream->GetPosMS(); + } } return 0; -- cgit v1.2.3 From 42342745f3e8506be79b4ebc8eb5bfe5982818ba Mon Sep 17 00:00:00 2001 From: withmorten Date: Thu, 4 Feb 2021 18:29:47 +0100 Subject: CHud::Draw fix --- src/render/Hud.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/render/Hud.cpp b/src/render/Hud.cpp index ba7d52db..91503917 100644 --- a/src/render/Hud.cpp +++ b/src/render/Hud.cpp @@ -1140,18 +1140,18 @@ void CHud::Draw() if (IntroRect.m_nTextureId >= 0) { CRect rect ( IntroRect.m_sRect.left, - IntroRect.m_sRect.top, + IntroRect.m_sRect.bottom, IntroRect.m_sRect.right, - IntroRect.m_sRect.bottom ); + IntroRect.m_sRect.top ); CTheScripts::ScriptSprites[IntroRect.m_nTextureId].Draw(rect, IntroRect.m_sColor); } else { CRect rect ( IntroRect.m_sRect.left, - IntroRect.m_sRect.top, + IntroRect.m_sRect.bottom, IntroRect.m_sRect.right, - IntroRect.m_sRect.bottom ); + IntroRect.m_sRect.top ); CSprite2d::DrawRect(rect, IntroRect.m_sColor); } -- cgit v1.2.3 From 8553120fdbfd74eb2d1609326acbdd8aaa382bea Mon Sep 17 00:00:00 2001 From: withmorten Date: Thu, 4 Feb 2021 19:47:47 +0100 Subject: add missing ASCII_STRCMP stuff --- src/core/config.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/core/config.h b/src/core/config.h index e75cdfb0..cc82f8d6 100644 --- a/src/core/config.h +++ b/src/core/config.h @@ -251,6 +251,12 @@ enum Config { #define FIX_BUGS_64 // Must have fixes to be able to run 64 bit build #endif +#define ASCII_STRCMP // use faster ascii str comparisons + +#if !defined _WIN32 || defined __MWERKS__ || defined __MINGW32__ || defined VANILLA_DEFINES +#undef ASCII_STRCMP +#endif + // Just debug menu entries #ifdef DEBUGMENU #define RELOADABLES // some debug menu options to reload TXD files -- cgit v1.2.3 From a78212ea800fe1919d5380beb25514e3887bcdea Mon Sep 17 00:00:00 2001 From: withmorten Date: Thu, 4 Feb 2021 23:43:04 +0100 Subject: fix MASTER crashes --- src/core/common.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/core/common.h b/src/core/common.h index 75ba8863..d39531cc 100644 --- a/src/core/common.h +++ b/src/core/common.h @@ -355,7 +355,7 @@ __inline__ void TRACE(char *f, ...) { } // this is re3 only, and so the function #ifndef MASTER #define assert(_Expression) (void)( (!!(_Expression)) || (re3_assert(#_Expression, __FILE__, __LINE__, __FUNCTION__), 0) ) #else -#define assert(_Expression) +#define assert(_Expression) (_Expression) #endif #define ASSERT assert -- cgit v1.2.3 From 09de511c37c32e13af3f72ded7f0f9e19f395ae2 Mon Sep 17 00:00:00 2001 From: Nikolay Korolev Date: Fri, 5 Feb 2021 11:31:54 +0300 Subject: fixed plane AI --- src/control/CarCtrl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/control/CarCtrl.cpp b/src/control/CarCtrl.cpp index c6d78882..d05d9827 100644 --- a/src/control/CarCtrl.cpp +++ b/src/control/CarCtrl.cpp @@ -2757,7 +2757,7 @@ void CCarCtrl::SteerAIPlaneTowardsTargetCoors(CAutomobile* pPlane) up.Normalise(); CVector forward(Cos(pPlane->m_fOrientation), Sin(pPlane->m_fOrientation), fForwardZ); forward.Normalise(); - CVector right = CrossProduct(forward, up); + CVector right = CrossProduct(up, forward); right.z -= 5.0f * pPlane->m_fPlaneSteer; right.Normalise(); up = CrossProduct(forward, right); -- cgit v1.2.3 From 102d105e0a50f829c6085a2e95082aedb7727b41 Mon Sep 17 00:00:00 2001 From: Nikolay Korolev Date: Fri, 5 Feb 2021 14:45:03 +0300 Subject: fix --- src/control/Script7.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/control/Script7.cpp b/src/control/Script7.cpp index 34a364a7..71099cc4 100644 --- a/src/control/Script7.cpp +++ b/src/control/Script7.cpp @@ -431,12 +431,12 @@ int8 CRunningScript::ProcessCommands1200To1299(int32 command) CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]); script_assert(pPed); if (ScriptParams[1]) { - pPed->bIsDucking = true; + pPed->bCrouchWhenShooting = true; pPed->SetDuck(ScriptParams[2], true); } else { pPed->ClearDuck(true); - pPed->bIsDucking = false; + pPed->bCrouchWhenShooting = false; } return 0; } -- cgit v1.2.3