diff options
-rw-r--r-- | engines/bladerunner/script/scene/ct09.cpp | 2 | ||||
-rw-r--r-- | engines/bladerunner/script/scene/ps09.cpp | 2 | ||||
-rw-r--r-- | engines/bladerunner/script/scene/ug04.cpp | 2 | ||||
-rw-r--r-- | engines/bladerunner/script/script.cpp | 8 |
4 files changed, 11 insertions, 3 deletions
diff --git a/engines/bladerunner/script/scene/ct09.cpp b/engines/bladerunner/script/scene/ct09.cpp index c209928239..bfb69bce9d 100644 --- a/engines/bladerunner/script/scene/ct09.cpp +++ b/engines/bladerunner/script/scene/ct09.cpp @@ -155,7 +155,7 @@ void SceneScriptCT09::SceneFrameAdvanced(int frame) { || frame == 46 || frame == 59 ) { - Sound_Play(kSfxNEON7, Random_Query(47, 47), 70, 70, 50); // a bug? random min == max + Sound_Play(kSfxNEON7, Random_Query(47, 47), 70, 70, 50); } } diff --git a/engines/bladerunner/script/scene/ps09.cpp b/engines/bladerunner/script/scene/ps09.cpp index ee94b1e0e1..832883f039 100644 --- a/engines/bladerunner/script/scene/ps09.cpp +++ b/engines/bladerunner/script/scene/ps09.cpp @@ -254,7 +254,7 @@ void SceneScriptPS09::SceneFrameAdvanced(int frame) { || frame == 52 || frame == 54 ) { - Sound_Play(kSfxNEON7, Random_Query(50, 33), 10, 10, 50); // TODO needs support for swapped min, max in Random_Query + Sound_Play(kSfxNEON7, Random_Query(50, 33), 10, 10, 50); } //return true; } diff --git a/engines/bladerunner/script/scene/ug04.cpp b/engines/bladerunner/script/scene/ug04.cpp index 288fcec297..b825869995 100644 --- a/engines/bladerunner/script/scene/ug04.cpp +++ b/engines/bladerunner/script/scene/ug04.cpp @@ -123,7 +123,7 @@ bool SceneScriptUG04::ClickedOn2DRegion(int region) { } void SceneScriptUG04::SceneFrameAdvanced(int frame) { - if (frame == 1) { // TODO - Maybe only play this sound when the train shows up + if (frame == 1) { Ambient_Sounds_Play_Sound(kSfxSUBWAY1, 90, -100, 100, 100); } } diff --git a/engines/bladerunner/script/script.cpp b/engines/bladerunner/script/script.cpp index 9e2454b895..b082983ea5 100644 --- a/engines/bladerunner/script/script.cpp +++ b/engines/bladerunner/script/script.cpp @@ -957,6 +957,14 @@ int ScriptBase::Global_Variable_Decrement(int var, int dec) { int ScriptBase::Random_Query(int min, int max) { debugC(9, kDebugScript, "Random_Query(%d, %d)", min, max); + if ( min == max ) + { + return min; + } + if ( min > max ) // there is at least one such case + { + return _vm->_rnd.getRandomNumberRng(max, min); // swap the arguments + } return _vm->_rnd.getRandomNumberRng(min, max); } |