From 9d4d83db0d9b9bd2921972a030a0c53566688fbb Mon Sep 17 00:00:00 2001 From: Nikolay Korolev Date: Thu, 14 May 2020 14:01:24 +0300 Subject: some fixes --- src/audio/sampman_miles.cpp | 4 ++++ src/audio/sampman_oal.cpp | 4 ++++ src/peds/Ped.cpp | 4 ++++ src/vehicles/Boat.cpp | 4 ++++ 4 files changed, 16 insertions(+) (limited to 'src') diff --git a/src/audio/sampman_miles.cpp b/src/audio/sampman_miles.cpp index caf2917f..e0c7170c 100644 --- a/src/audio/sampman_miles.cpp +++ b/src/audio/sampman_miles.cpp @@ -1449,7 +1449,11 @@ cSampleManager::IsPedCommentLoaded(uint32 nComment) for ( int32 i = 0; i < _TODOCONST(3); i++ ) { +#ifdef FIX_BUGS + slot = (nCurrentPedSlot - i - 1) % ARRAY_SIZE(nPedSlotSfx); +#else slot = nCurrentPedSlot - i - 1; +#endif if ( nComment == nPedSlotSfx[slot] ) return true; } diff --git a/src/audio/sampman_oal.cpp b/src/audio/sampman_oal.cpp index 64b763ec..7276a895 100644 --- a/src/audio/sampman_oal.cpp +++ b/src/audio/sampman_oal.cpp @@ -779,7 +779,11 @@ cSampleManager::IsPedCommentLoaded(uint32 nComment) for ( int32 i = 0; i < _TODOCONST(3); i++ ) { +#ifdef FIX_BUGS + slot = (nCurrentPedSlot - i - 1) % ARRAY_SIZE(nPedSlotSfx); +#else slot = nCurrentPedSlot - i - 1; +#endif if ( nComment == nPedSlotSfx[slot] ) return true; } diff --git a/src/peds/Ped.cpp b/src/peds/Ped.cpp index d261385a..fd8fd540 100644 --- a/src/peds/Ped.cpp +++ b/src/peds/Ped.cpp @@ -16166,7 +16166,11 @@ CPed::SeekCar(void) } if (dest.x == 0.0f && dest.y == 0.0f) { +#ifdef FIX_BUGS + if ((!IsPlayer() && CharCreatedBy != MISSION_CHAR) || vehToSeek->VehicleCreatedBy != MISSION_VEHICLE || vehToSeek->pDriver || !vehToSeek->CanPedOpenLocks(this)) { +#else if ((!IsPlayer() && CharCreatedBy != MISSION_CHAR) || vehToSeek->VehicleCreatedBy != MISSION_VEHICLE || vehToSeek->pDriver) { +#endif RestorePreviousState(); if (IsPlayer()) { ClearObjective(); diff --git a/src/vehicles/Boat.cpp b/src/vehicles/Boat.cpp index d992d190..72fca542 100644 --- a/src/vehicles/Boat.cpp +++ b/src/vehicles/Boat.cpp @@ -184,7 +184,11 @@ CBoat::ProcessControl(void) } float collisionDamage = pHandling->fCollisionDamageMultiplier * m_fDamageImpulse; +#ifdef FIX_BUGS + if (collisionDamage > 25.0f && GetStatus() != STATUS_WRECKED && m_fHealth >= 150.0f && !bCollisionProof) { +#else if(collisionDamage > 25.0f && GetStatus() != STATUS_WRECKED && m_fHealth >= 150.0f){ +#endif float prevHealth = m_fHealth; if(this == FindPlayerVehicle()){ if(bTakeLessDamage) -- cgit v1.2.3 From 8e0b132f43b0ac952255bf85b0d1e22e3879d694 Mon Sep 17 00:00:00 2001 From: Nikolay Korolev Date: Thu, 14 May 2020 14:03:56 +0300 Subject: it works differently --- src/audio/sampman_miles.cpp | 6 +++--- src/audio/sampman_oal.cpp | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/audio/sampman_miles.cpp b/src/audio/sampman_miles.cpp index e0c7170c..a2a206a4 100644 --- a/src/audio/sampman_miles.cpp +++ b/src/audio/sampman_miles.cpp @@ -1449,10 +1449,10 @@ cSampleManager::IsPedCommentLoaded(uint32 nComment) for ( int32 i = 0; i < _TODOCONST(3); i++ ) { -#ifdef FIX_BUGS - slot = (nCurrentPedSlot - i - 1) % ARRAY_SIZE(nPedSlotSfx); -#else slot = nCurrentPedSlot - i - 1; +#ifdef FIX_BUGS + if (slot < 0) + slot += ARRAY_SIZE(nPedSlotSfx); #endif if ( nComment == nPedSlotSfx[slot] ) return true; diff --git a/src/audio/sampman_oal.cpp b/src/audio/sampman_oal.cpp index 7276a895..30efd7f5 100644 --- a/src/audio/sampman_oal.cpp +++ b/src/audio/sampman_oal.cpp @@ -779,10 +779,10 @@ cSampleManager::IsPedCommentLoaded(uint32 nComment) for ( int32 i = 0; i < _TODOCONST(3); i++ ) { -#ifdef FIX_BUGS - slot = (nCurrentPedSlot - i - 1) % ARRAY_SIZE(nPedSlotSfx); -#else slot = nCurrentPedSlot - i - 1; +#ifdef FIX_BUGS + if (slot < 0) + slot += ARRAY_SIZE(nPedSlotSfx); #endif if ( nComment == nPedSlotSfx[slot] ) return true; -- cgit v1.2.3