X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fmisc.c;h=2c01f36401e0e7eed881a71f23b5e1f4ab2baa3e;hb=cd56ad175c592ea3047703d57c11d2f3a61f7f37;hp=b11c080fca4ead384a8ab0bce9b0c000fedf1315;hpb=d82356191574038684ec15bb2e13fe803de52b53;p=rocksndiamonds.git diff --git a/src/misc.c b/src/misc.c index b11c080f..2c01f364 100644 --- a/src/misc.c +++ b/src/misc.c @@ -159,9 +159,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)