diff options
author | Fire_Head <Fire-Head@users.noreply.github.com> | 2020-05-26 21:16:56 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-26 21:16:56 +0200 |
commit | ae8a377f26f9b56b5156b0462c30c5c49af7dd8a (patch) | |
tree | f15b8d6bb195ad71ffd9e7051c26a5b42e2f71a7 /src/audio/sampman_miles.cpp | |
parent | Merge pull request #550 from erorcun/miami (diff) | |
parent | fix UB shit (diff) | |
download | re3-ae8a377f26f9b56b5156b0462c30c5c49af7dd8a.tar re3-ae8a377f26f9b56b5156b0462c30c5c49af7dd8a.tar.gz re3-ae8a377f26f9b56b5156b0462c30c5c49af7dd8a.tar.bz2 re3-ae8a377f26f9b56b5156b0462c30c5c49af7dd8a.tar.lz re3-ae8a377f26f9b56b5156b0462c30c5c49af7dd8a.tar.xz re3-ae8a377f26f9b56b5156b0462c30c5c49af7dd8a.tar.zst re3-ae8a377f26f9b56b5156b0462c30c5c49af7dd8a.zip |
Diffstat (limited to '')
-rw-r--r-- | src/audio/sampman_miles.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/audio/sampman_miles.cpp b/src/audio/sampman_miles.cpp index a2a206a4..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,11 +1464,15 @@ cSampleManager::IsPedCommentLoaded(uint32 nComment) int32 cSampleManager::_GetPedCommentSlot(uint32 nComment) { - uint8 slot; + int8 slot; 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; } |