summaryrefslogtreecommitdiffstats
path: root/src/audio
diff options
context:
space:
mode:
authorNikolay Korolev <nickvnuk@gmail.com>2020-05-14 13:03:56 +0200
committerNikolay Korolev <nickvnuk@gmail.com>2020-05-14 13:03:56 +0200
commit8e0b132f43b0ac952255bf85b0d1e22e3879d694 (patch)
treeaff5be054e1fb2ac6d8d34dd8629716132a97dd0 /src/audio
parentsome fixes (diff)
downloadre3-8e0b132f43b0ac952255bf85b0d1e22e3879d694.tar
re3-8e0b132f43b0ac952255bf85b0d1e22e3879d694.tar.gz
re3-8e0b132f43b0ac952255bf85b0d1e22e3879d694.tar.bz2
re3-8e0b132f43b0ac952255bf85b0d1e22e3879d694.tar.lz
re3-8e0b132f43b0ac952255bf85b0d1e22e3879d694.tar.xz
re3-8e0b132f43b0ac952255bf85b0d1e22e3879d694.tar.zst
re3-8e0b132f43b0ac952255bf85b0d1e22e3879d694.zip
Diffstat (limited to 'src/audio')
-rw-r--r--src/audio/sampman_miles.cpp6
-rw-r--r--src/audio/sampman_oal.cpp6
2 files changed, 6 insertions, 6 deletions
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;