patches/wesnoth-09-fixrand.diff
author sobi
Sun, 04 May 2008 13:23:47 +0000
changeset 1085 7eaac9b496cc
permissions -rw-r--r--
2008-05-04 Petr Sobotka <[email protected]> * SFEwesnoth-dev.spec: Development release of Battle for Wesnoth It can be installed in parallel with stable version. * patches/wesnoth-10-fixstd.diff: * patches/wesnoth-11-fixstrict.diff: * patches/wesnoth-12-fixmisshpp.diff:

--- wesnoth-1.5.0/src/formula.cpp.fixrand	2008-04-27 21:14:59.895726673 +0200
+++ wesnoth-1.5.0/src/formula.cpp	2008-04-27 21:15:50.211324858 +0200
@@ -298,7 +298,7 @@
 	static int dice_roll(int num_rolls, int faces) {
 		int res = 0;
 		while(faces > 0 && num_rolls-- > 0) {
-			res += (rand()%faces)+1;
+			res += (std::rand()%faces)+1;
 		}
 		return res;
 	}
@@ -882,7 +882,7 @@
 
 int main()
 {
-	srand(time(NULL));
+	std::srand(time(NULL));
 	mock_char c;
 	mock_party p;
 	try {