From 6bf79120dcd535dc6a63c4d0da858444facb0d8d Mon Sep 17 00:00:00 2001 From: shfil Date: Mon, 18 May 2020 21:08:01 +0200 Subject: Fix string assignment (aldlist.cpp) --- src/audio/oal/aldlist.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/audio') diff --git a/src/audio/oal/aldlist.cpp b/src/audio/oal/aldlist.cpp index 458b7c80..7401e036 100644 --- a/src/audio/oal/aldlist.cpp +++ b/src/audio/oal/aldlist.cpp @@ -73,7 +73,7 @@ ALDeviceList::ALDeviceList() if ((bNewName) && (actualDeviceName != NULL) && (strlen(actualDeviceName) > 0)) { memset(&ALDeviceInfo, 0, sizeof(ALDEVICEINFO)); ALDeviceInfo.bSelected = true; - ALDeviceInfo.strDeviceName.assign(actualDeviceName, strlen(actualDeviceName)); + ALDeviceInfo.strDeviceName = actualDeviceName; alcGetIntegerv(device, ALC_MAJOR_VERSION, sizeof(int), &ALDeviceInfo.iMajorVersion); alcGetIntegerv(device, ALC_MINOR_VERSION, sizeof(int), &ALDeviceInfo.iMinorVersion); -- cgit v1.2.3 From c0c8278c635258fc72636db0bbf59d7c99c4ba61 Mon Sep 17 00:00:00 2001 From: Nikolay Korolev Date: Wed, 20 May 2020 20:45:07 +0300 Subject: fixed ped comment --- src/audio/sampman_miles.cpp | 4 ++++ src/audio/sampman_oal.cpp | 4 ++++ 2 files changed, 8 insertions(+) (limited to 'src/audio') diff --git a/src/audio/sampman_miles.cpp b/src/audio/sampman_miles.cpp index a2a206a4..ad2c512f 100644 --- a/src/audio/sampman_miles.cpp +++ b/src/audio/sampman_miles.cpp @@ -1469,6 +1469,10 @@ cSampleManager::_GetPedCommentSlot(uint32 nComment) for ( int32 i = 0; i < _TODOCONST(3); i++ ) { slot = nCurrentPedSlot - i - 1; +#ifdef FIX_BUGS + if (slot < 0) + slot += ARRAY_SIZE(nPedSlotSfx); +#endif if ( nComment == nPedSlotSfx[slot] ) return slot; } diff --git a/src/audio/sampman_oal.cpp b/src/audio/sampman_oal.cpp index 30efd7f5..f16afbba 100644 --- a/src/audio/sampman_oal.cpp +++ b/src/audio/sampman_oal.cpp @@ -800,6 +800,10 @@ cSampleManager::_GetPedCommentSlot(uint32 nComment) for (int32 i = 0; i < _TODOCONST(3); i++) { slot = nCurrentPedSlot - i - 1; +#ifdef FIX_BUGS + if (slot < 0) + slot += ARRAY_SIZE(nPedSlotSfx); +#endif if (nComment == nPedSlotSfx[slot]) return slot; } -- cgit v1.2.3 From 3405cfffb76b1e0b7511e2fc394c0121f4aa43a8 Mon Sep 17 00:00:00 2001 From: Nikolay Korolev Date: Wed, 20 May 2020 23:52:17 +0300 Subject: fixed dumb --- src/audio/sampman_miles.cpp | 4 ++-- src/audio/sampman_oal.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/audio') diff --git a/src/audio/sampman_miles.cpp b/src/audio/sampman_miles.cpp index ad2c512f..d625ac35 100644 --- a/src/audio/sampman_miles.cpp +++ b/src/audio/sampman_miles.cpp @@ -1445,7 +1445,7 @@ cSampleManager::IsSampleBankLoaded(uint8 nBank) bool cSampleManager::IsPedCommentLoaded(uint32 nComment) { - uint8 slot; + int8 slot; for ( int32 i = 0; i < _TODOCONST(3); i++ ) { @@ -1464,7 +1464,7 @@ cSampleManager::IsPedCommentLoaded(uint32 nComment) int32 cSampleManager::_GetPedCommentSlot(uint32 nComment) { - uint8 slot; + int8 slot; for ( int32 i = 0; i < _TODOCONST(3); i++ ) { diff --git a/src/audio/sampman_oal.cpp b/src/audio/sampman_oal.cpp index f16afbba..f6f3a393 100644 --- a/src/audio/sampman_oal.cpp +++ b/src/audio/sampman_oal.cpp @@ -775,7 +775,7 @@ cSampleManager::IsPedCommentLoaded(uint32 nComment) { ASSERT( nComment < TOTAL_AUDIO_SAMPLES ); - uint8 slot; + int8 slot; for ( int32 i = 0; i < _TODOCONST(3); i++ ) { @@ -795,7 +795,7 @@ cSampleManager::IsPedCommentLoaded(uint32 nComment) int32 cSampleManager::_GetPedCommentSlot(uint32 nComment) { - uint8 slot; + int8 slot; for (int32 i = 0; i < _TODOCONST(3); i++) { -- cgit v1.2.3