[Scummvm-git-logs] scummvm master -> a179d984b4eb3dce2dbc1b9c298df99c679d042a

dreammaster dreammaster at scummvm.org
Sun Jun 20 17:56:04 UTC 2021


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
a179d984b4 AGS: Fix upper limit for random number generation


Commit: a179d984b4eb3dce2dbc1b9c298df99c679d042a
    https://github.com/scummvm/scummvm/commit/a179d984b4eb3dce2dbc1b9c298df99c679d042a
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2021-06-20T10:55:55-07:00

Commit Message:
AGS: Fix upper limit for random number generation

Changed paths:
    engines/ags/engine/ac/math.cpp


diff --git a/engines/ags/engine/ac/math.cpp b/engines/ags/engine/ac/math.cpp
index e72d73d2b6..e07c6b3c8c 100644
--- a/engines/ags/engine/ac/math.cpp
+++ b/engines/ags/engine/ac/math.cpp
@@ -139,8 +139,7 @@ float Math_Sqrt(float value) {
 }
 
 int __Rand(int upto) {
-	upto++;
-	if (upto < 1)
+	if (upto < 0)
 		quit("!Random: invalid parameter passed -- must be at least 0.");
 	return ::AGS::g_vm->getRandomNumber(upto);
 }




More information about the Scummvm-git-logs mailing list