summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNikolay Korolev <nickvnuk@gmail.com>2020-05-20 19:45:07 +0200
committerNikolay Korolev <nickvnuk@gmail.com>2020-05-20 19:45:07 +0200
commitc0c8278c635258fc72636db0bbf59d7c99c4ba61 (patch)
treeb4df9ad8f815c30cf127124204419f42cdd75bf6
parentfixed script bug (diff)
downloadre3-c0c8278c635258fc72636db0bbf59d7c99c4ba61.tar
re3-c0c8278c635258fc72636db0bbf59d7c99c4ba61.tar.gz
re3-c0c8278c635258fc72636db0bbf59d7c99c4ba61.tar.bz2
re3-c0c8278c635258fc72636db0bbf59d7c99c4ba61.tar.lz
re3-c0c8278c635258fc72636db0bbf59d7c99c4ba61.tar.xz
re3-c0c8278c635258fc72636db0bbf59d7c99c4ba61.tar.zst
re3-c0c8278c635258fc72636db0bbf59d7c99c4ba61.zip
-rw-r--r--src/audio/sampman_miles.cpp4
-rw-r--r--src/audio/sampman_oal.cpp4
2 files changed, 8 insertions, 0 deletions
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;
}