From f887d515fa866c5be2830d4ff7cbeddb74fb8a1a Mon Sep 17 00:00:00 2001 From: Sergeanur Date: Sun, 8 Aug 2021 17:53:01 +0300 Subject: [PATCH 1/4] Sync fix from miami --- src/core/Radar.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/core/Radar.cpp b/src/core/Radar.cpp index 0792008a..ff9231c6 100644 --- a/src/core/Radar.cpp +++ b/src/core/Radar.cpp @@ -1003,9 +1003,11 @@ INITSAVEBUF WriteSaveHeader(buf, 'R', 'D', 'R', '\0', *size - SAVE_HEADER_SIZE); #ifdef MAP_ENHANCEMENTS + bool bWaypointDeleted = false; if (TargetMarkerId != -1) { ClearBlip(TargetMarkerId); TargetMarkerId = -1; + bWaypointDeleted = true; } #endif @@ -1030,6 +1032,11 @@ INITSAVEBUF SkipSaveBuf(buf, sizeof(sRadarTraceSave)); } +#ifdef MAP_ENHANCEMENTS + if(bWaypointDeleted) + ToggleTargetMarker(TargetMarkerPos.x, TargetMarkerPos.y); +#endif + VALIDATESAVEBUF(*size); } From 76a22c0d1355c62f791c353d2dcaf5960ccbefa1 Mon Sep 17 00:00:00 2001 From: Sergeanur Date: Sun, 8 Aug 2021 18:02:23 +0300 Subject: [PATCH 2/4] Fix --- src/core/Camera.cpp | 2 +- src/core/Camera.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/Camera.cpp b/src/core/Camera.cpp index 3ebd52f2..e7cd65a0 100644 --- a/src/core/Camera.cpp +++ b/src/core/Camera.cpp @@ -4076,7 +4076,7 @@ CCamera::IsPointVisible(const CVector ¢er, const CMatrix *mat) } bool -CCamera::IsSphereVisible(const CVector ¢er, float radius, Const CMatrix *mat) +CCamera::IsSphereVisible(const CVector ¢er, float radius, const CMatrix *mat) { #ifdef GTA_PS2 CVuVector c; diff --git a/src/core/Camera.h b/src/core/Camera.h index 7612b937..39ecb760 100644 --- a/src/core/Camera.h +++ b/src/core/Camera.h @@ -631,7 +631,7 @@ public: CVector &GetGameCamPosition(void) { return m_vecGameCamPos; } void CalculateDerivedValues(void); bool IsPointVisible(const CVector ¢er, const CMatrix *mat); - bool IsSphereVisible(const CVector ¢er, float radius, Const CMatrix *mat); + bool IsSphereVisible(const CVector ¢er, float radius, const CMatrix *mat); bool IsSphereVisible(const CVector ¢er, float radius); bool IsBoxVisible(CVUVECTOR *box, const CMatrix *mat); }; From 42ad9c437802116afaf121016a4f6a6aff47085e Mon Sep 17 00:00:00 2001 From: Barracuda6 <41495078+Barracuda6@users.noreply.github.com> Date: Sun, 8 Aug 2021 10:57:48 -0400 Subject: [PATCH 3/4] Comment out text following #endif --- src/vehicles/Train.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vehicles/Train.cpp b/src/vehicles/Train.cpp index 5f0cf36a..3a04b614 100644 --- a/src/vehicles/Train.cpp +++ b/src/vehicles/Train.cpp @@ -292,7 +292,7 @@ CTrain::ProcessControl(void) TrainHitStuff(s->m_lists[ENTITYLIST_PEDS_OVERLAP]); } } -#endif GTA_TRAIN +#endif // GTA_TRAIN } void From 2ee32abf8411a3fd756dd0a2f08681aed0308116 Mon Sep 17 00:00:00 2001 From: Nikolay Korolev Date: Mon, 9 Aug 2021 00:07:02 +0300 Subject: [PATCH 4/4] fix bug in CCurves --- src/control/Curves.cpp | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/src/control/Curves.cpp b/src/control/Curves.cpp index 31a2767a..5b590440 100644 --- a/src/control/Curves.cpp +++ b/src/control/Curves.cpp @@ -19,17 +19,27 @@ void CCurves::CalcCurvePoint(CVector* pPos1, CVector* pPos2, CVector* pDir1, CVe float actualFactor = CalcSpeedScaleFactor(pPos1, pPos2, pDir1->x, pDir1->y, pDir2->x, pDir2->y); CVector2D dir1 = *pDir1 * actualFactor; CVector2D dir2 = *pDir2 * actualFactor; - float t1 = Abs(DotProduct2D(*pPos1 - *pPos2, *pDir1)); - float t2 = Abs(DotProduct2D(*pPos2 - *pPos1, *pDir2)); + float t1 = Abs(DotProduct2D(*pPos2 - *pPos1, *pDir1)); + float t2 = Abs(DotProduct2D(*pPos1 - *pPos2, *pDir2)); float curveCoef; if (t1 > t2) { - if (between < (t1 - t2) / (t1 + t2)) + float coef = (t1 - t2) / (t1 + t2); +#ifdef FIX_BUGS + if (between <= coef) +#else + if (between < coef) +#endif curveCoef = 0.0f; else - curveCoef = 0.5f - 0.5f * Cos(3.1415f * (t1 + t2) / (2 * t2) * (between - (t1 - t2) / (t1 + t2))); + curveCoef = 0.5f - 0.5f * Cos(3.1415f * (between - coef) * (t1 + t2) / (2 * t2)); } else { - if (2 * t1 / (t1 + t2) < between) + float coef = 2 * t1 / (t1 + t2); +#ifdef FIX_BUGS + if (coef <= between) +#else + if (coef < between) +#endif curveCoef = 1.0f; else curveCoef = 0.5f - 0.5f * Cos(3.1415f * between * (t1 + t2) / (2 * t1));