aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorMatthew Hoops2010-10-20 03:01:03 +0000
committerMatthew Hoops2010-10-20 03:01:03 +0000
commit21a29d3b45183d0bd79f756d7e2fe90b9c372f65 (patch)
treed80877c3da7d4f3624cd72284b2071bc20545e7d /engines
parent59c054938a7fd2036badbecfbb3b72ad55b0e820 (diff)
downloadscummvm-rg350-21a29d3b45183d0bd79f756d7e2fe90b9c372f65.tar.gz
scummvm-rg350-21a29d3b45183d0bd79f756d7e2fe90b9c372f65.tar.bz2
scummvm-rg350-21a29d3b45183d0bd79f756d7e2fe90b9c372f65.zip
SCUMM: Have o6_getRandomNumber() use the absolute value of the argument
The Backyard Baseball series calls the function with negative numbers, but expects a positive result. The games are now actually playable. Thanks to Kirben for assistance in tracking this bug down. svn-id: r53630
Diffstat (limited to 'engines')
-rw-r--r--engines/scumm/script_v6.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/engines/scumm/script_v6.cpp b/engines/scumm/script_v6.cpp
index c5841dfaf4..ede32623aa 100644
--- a/engines/scumm/script_v6.cpp
+++ b/engines/scumm/script_v6.cpp
@@ -1285,7 +1285,7 @@ void ScummEngine_v6::o6_loadRoomWithEgo() {
void ScummEngine_v6::o6_getRandomNumber() {
int rnd;
- rnd = _rnd.getRandomNumber(pop());
+ rnd = _rnd.getRandomNumber(ABS(pop()));
if (VAR_RANDOM_NR != 0xFF)
VAR(VAR_RANDOM_NR) = rnd;
push(rnd);