diff options
author | Thanasis Antoniou | 2019-07-29 13:56:47 +0300 |
---|---|---|
committer | Thanasis Antoniou | 2019-07-29 13:57:56 +0300 |
commit | c8a23cc401ecef6deac468766aba185bf8633db7 (patch) | |
tree | 162b16146345b5d650be0e8c272122f0b3097991 /engines/bladerunner/ui | |
parent | 70126b9685912bbce290511210ab6bcccd40bcd3 (diff) | |
download | scummvm-rg350-c8a23cc401ecef6deac468766aba185bf8633db7.tar.gz scummvm-rg350-c8a23cc401ecef6deac468766aba185bf8633db7.tar.bz2 scummvm-rg350-c8a23cc401ecef6deac468766aba185bf8633db7.zip |
BLADERUNNER: Fix unsorted args for getRandomNumberRng
Fix for bug #11034
Diffstat (limited to 'engines/bladerunner/ui')
-rw-r--r-- | engines/bladerunner/ui/kia_section_pogo.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/engines/bladerunner/ui/kia_section_pogo.cpp b/engines/bladerunner/ui/kia_section_pogo.cpp index cd0bb27efb..967ed37cbb 100644 --- a/engines/bladerunner/ui/kia_section_pogo.cpp +++ b/engines/bladerunner/ui/kia_section_pogo.cpp @@ -263,6 +263,7 @@ void KIASectionPogo::draw(Graphics::Surface &surface) { _vm->_mainFont->drawString(&surface, title, 313 - _vm->_mainFont->getStringWidth(title) / 2, 143, surface.w, surface.format.RGBToColor(240, 232, 192)); int y = 158; + int lineTextWidth; for (int i = 0; i < kLineCount; ++i) { if (updateTimeout) { if (_lineTimeouts[i] > 0) { @@ -270,7 +271,8 @@ void KIASectionPogo::draw(Graphics::Surface &surface) { } else { _lineTexts[i] = _strings[_stringIndex]; _lineTimeouts[i] = 63; - _lineOffsets[i] = _vm->_rnd.getRandomNumberRng(0, 306 - _vm->_mainFont->getStringWidth(_lineTexts[i])) + 155; + lineTextWidth = _vm->_mainFont->getStringWidth(_lineTexts[i]); + _lineOffsets[i] = _vm->_rnd.getRandomNumberRng(0, (306 - lineTextWidth) > 0 ? (306 - lineTextWidth) : 0) + 155; _stringIndex = (_stringIndex + 1) % kStringCount; } |