diff options
author | Sergeanur <s.anureev@yandex.ua> | 2020-05-22 16:41:03 +0200 |
---|---|---|
committer | Sergeanur <s.anureev@yandex.ua> | 2020-05-22 16:41:03 +0200 |
commit | ab161d12d8cf0326bf072777b7eeef31e8cd516c (patch) | |
tree | d9fb154d49338cab92e278fc34952386daa9e314 /src/audio/sampman_miles.cpp | |
parent | opus support (diff) | |
parent | fixes for CPhysical and friends (diff) | |
download | re3-ab161d12d8cf0326bf072777b7eeef31e8cd516c.tar re3-ab161d12d8cf0326bf072777b7eeef31e8cd516c.tar.gz re3-ab161d12d8cf0326bf072777b7eeef31e8cd516c.tar.bz2 re3-ab161d12d8cf0326bf072777b7eeef31e8cd516c.tar.lz re3-ab161d12d8cf0326bf072777b7eeef31e8cd516c.tar.xz re3-ab161d12d8cf0326bf072777b7eeef31e8cd516c.tar.zst re3-ab161d12d8cf0326bf072777b7eeef31e8cd516c.zip |
Diffstat (limited to 'src/audio/sampman_miles.cpp')
-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; } |