From 21a29d3b45183d0bd79f756d7e2fe90b9c372f65 Mon Sep 17 00:00:00 2001 From: Matthew Hoops Date: Wed, 20 Oct 2010 03:01:03 +0000 Subject: 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 --- engines/scumm/script_v6.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/scumm/script_v6.cpp') 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); -- cgit v1.2.3