diff --git a/game.h b/game.h index 33f585a1..0bc70492 100644 --- a/game.h +++ b/game.h @@ -41,7 +41,7 @@ class Game; #include "object.h" #include "orders.h" -#define CURRENT_ATL_VER MAKE_ATL_VER( 4, 2, 68 ) +#define CURRENT_ATL_VER MAKE_ATL_VER( 4, 2, 60 ) class OrdersCheck { diff --git a/gameio.cpp b/gameio.cpp index e4a83b1f..09892359 100644 --- a/gameio.cpp +++ b/gameio.cpp @@ -27,11 +27,6 @@ #include #include #include -extern "C" { -#include "i_rand.h" -} - -static randctx isaac_ctx; char buf[256]; @@ -53,6 +48,7 @@ static void morewait() void initIO() { + // I am unsure of why this is hard-coded. seedrandom( 1783 ); } @@ -69,32 +65,24 @@ int getrandom(int range) if (neg) range = -range; - unsigned long i = isaac_rand( &isaac_ctx ); - i %= range; + int random = rand() % range; - int ret = 0; if (neg) - ret = (int)(i * -1); - else - ret = (int)i; + random = (int)(random * -1); - return ret; + return random; } void seedrandom(int num) { - isaac_ctx.randa = isaac_ctx.randb = isaac_ctx.randc = (ub4)0; - - for (ub4 i = 0; i < RANDSIZ; ++i) - { - isaac_ctx.randrsl[i] = (ub4)num + i; - } - randinit( &isaac_ctx, TRUE ); + // Now to do this directly. + srand((unsigned int)num); } void seedrandomrandom() { - seedrandom( time(0) ); + time_t now = clock(); + seedrandom((unsigned int)now); } int Agetint()