[Scummvm-cvs-logs] SF.net SVN: scummvm:[42293] scummvm/trunk/engines/kyra/lol.cpp

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Thu Jul 9 17:32:25 CEST 2009


Revision: 42293
          http://scummvm.svn.sourceforge.net/scummvm/?rev=42293&view=rev
Author:   lordhoto
Date:     2009-07-09 15:32:25 +0000 (Thu, 09 Jul 2009)

Log Message:
-----------
Cleanup rollDice (the results of the old and the new function are almost identical).

Modified Paths:
--------------
    scummvm/trunk/engines/kyra/lol.cpp

Modified: scummvm/trunk/engines/kyra/lol.cpp
===================================================================
--- scummvm/trunk/engines/kyra/lol.cpp	2009-07-09 15:32:06 UTC (rev 42292)
+++ scummvm/trunk/engines/kyra/lol.cpp	2009-07-09 15:32:25 UTC (rev 42293)
@@ -1877,16 +1877,9 @@
 		return 0;
 
 	int res = 0;
-	int d = 0;
+	while (times--)
+		res += _rnd.getRandomNumberRng(1, pips);
 
-	do {
-		int val = (((int)_rnd.getRandomNumber(0x7fff) * pips) / 0x8000) + 1;
-		if (val > pips)
-			val -= pips;
-		res += val;
-		d++;
-	} while (d < times);
-
 	return res;
 }
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list