rnd-19981123-2
[rocksndiamonds.git] / src / misc.c
index b11c080fca4ead384a8ab0bce9b0c000fedf1315..88f1cd7719ba53f99210dd0acddeeaa99cd37bcd 100644 (file)
@@ -27,6 +27,9 @@
 #include "random.h"
 #include "joystick.h"
 
+/* maximal allowed length of a command line option */
+#define MAX_OPTION_LEN         256
+
 static unsigned long mainCounter(int mode)
 {
   static struct timeval base_time = { 0, 0 };
@@ -159,9 +162,22 @@ unsigned int SimpleRND(unsigned int max)
   return (root % max);
 }
 
+#ifdef DEBUG
+static unsigned int last_RND_value = 0;
+
+unsigned int last_RND()
+{
+  return last_RND_value;
+}
+#endif
+
 unsigned int RND(unsigned int max)
 {
+#ifdef DEBUG
+  return (last_RND_value = random_linux_libc() % max);
+#else
   return (random_linux_libc() % max);
+#endif
 }
 
 unsigned int InitRND(long seed)