aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorEugene Sandulenko2019-07-13 17:48:12 +0200
committerEugene Sandulenko2019-09-03 17:17:19 +0200
commitf8769966f161a2be413eeef01517d96005f61c84 (patch)
tree05202b1ebc4d055d0638ecbdcf6715033d79eae9 /engines
parentac9a62da03218318503cb1f13dfd0165389caf06 (diff)
downloadscummvm-rg350-f8769966f161a2be413eeef01517d96005f61c84.tar.gz
scummvm-rg350-f8769966f161a2be413eeef01517d96005f61c84.tar.bz2
scummvm-rg350-f8769966f161a2be413eeef01517d96005f61c84.zip
HDB: Fix getRandomNumber usage
Diffstat (limited to 'engines')
-rw-r--r--engines/hdb/window.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/engines/hdb/window.cpp b/engines/hdb/window.cpp
index cf6b79b88f..8df868ec37 100644
--- a/engines/hdb/window.cpp
+++ b/engines/hdb/window.cpp
@@ -1043,7 +1043,7 @@ void Window::drawDeliveries() {
if (!_dlvsInfo.go2) {
_dlvsInfo.go2 = true;
_dlvsInfo.delay2 = g_hdb->getTimeSlice() + 500;
- g_hdb->_sound->playSound(crazySounds[g_hdb->_rnd->getRandomNumber(kNumCrazy)]);
+ g_hdb->_sound->playSound(crazySounds[g_hdb->_rnd->getRandomNumber(kNumCrazy - 1)]);
}
}
}
@@ -1057,7 +1057,7 @@ void Window::drawDeliveries() {
if (!_dlvsInfo.go3) {
_dlvsInfo.go3 = true;
_dlvsInfo.delay3 = g_hdb->getTimeSlice() + 500;
- g_hdb->_sound->playSound(crazySounds[g_hdb->_rnd->getRandomNumber(kNumCrazy)]);
+ g_hdb->_sound->playSound(crazySounds[g_hdb->_rnd->getRandomNumber(kNumCrazy - 1)]);
}
}
}
@@ -1071,7 +1071,7 @@ void Window::drawDeliveries() {
g_hdb->_gfx->drawText("to ");
g_hdb->_gfx->drawText(d->destTextName);
- g_hdb->_sound->playSound(crazySounds[g_hdb->_rnd->getRandomNumber(kNumCrazy)]);
+ g_hdb->_sound->playSound(crazySounds[g_hdb->_rnd->getRandomNumber(kNumCrazy - 1)]);
_dlvsInfo.animate = false;
}
}
@@ -1180,8 +1180,8 @@ void Window::drawPanicZone() {
// Move PANIC ZONE to screen center
case PANICZONE_START:
- xx = g_hdb->_rnd->getRandomNumber(10) - 5;
- yy = g_hdb->_rnd->getRandomNumber(10) - 5;
+ xx = g_hdb->_rnd->getRandomNumber(9) - 5;
+ yy = g_hdb->_rnd->getRandomNumber(9) - 5;
_pzInfo.x1 += _pzInfo.xv;
_pzInfo.y1++;
_pzInfo.x2 += _pzInfo.yv;
@@ -1195,8 +1195,8 @@ void Window::drawPanicZone() {
break;
case PANICZONE_TITLESTOP:
- xx = g_hdb->_rnd->getRandomNumber(10) - 5;
- yy = g_hdb->_rnd->getRandomNumber(10) - 5;
+ xx = g_hdb->_rnd->getRandomNumber(9) - 5;
+ yy = g_hdb->_rnd->getRandomNumber(9) - 5;
_pzInfo.gfxPanic->drawMasked(_pzInfo.x1 + xx, _pzInfo.y1 + yy);
_pzInfo.gfxZone->drawMasked(_pzInfo.x2 + yy, _pzInfo.y2 + xx);
_pzInfo.timer--;
@@ -1206,8 +1206,8 @@ void Window::drawPanicZone() {
break;
case PANICZONE_BLASTOFF:
- xx = g_hdb->_rnd->getRandomNumber(10) - 5;
- yy = g_hdb->_rnd->getRandomNumber(10) - 5;
+ xx = g_hdb->_rnd->getRandomNumber(9) - 5;
+ yy = g_hdb->_rnd->getRandomNumber(9) - 5;
_pzInfo.y1 -= 10;
_pzInfo.y2 += 10;
_pzInfo.gfxPanic->drawMasked(_pzInfo.x1 + xx, _pzInfo.y1 + yy);