diff --git a/source/src/server.cpp b/source/src/server.cpp index cda3bcbe..6d90dd11 100644 --- a/source/src/server.cpp +++ b/source/src/server.cpp @@ -3288,6 +3288,8 @@ void localconnect() void initserver(bool dedicated, int uprate, const char *sdesc, const char *sdesc_pre, const char *sdesc_suf, const char *ip, int serverport, const char *master, const char *passwd, int maxcl, const char *maprot, const char *adminpwd, const char *pwdfile, const char *blfile, const char *srvmsg, int scthreshold) { + srand(time(NULL)); + if(serverport<=0) serverport = CUBE_DEFAULT_SERVER_PORT; if(passwd) s_strcpy(serverpassword, passwd); maxclients = maxcl > 0 ? min(maxcl, MAXCLIENTS) : DEFAULTCLIENTS; diff --git a/source/src/tools.h b/source/src/tools.h index 364c13ee..c6d26a4c 100644 --- a/source/src/tools.h +++ b/source/src/tools.h @@ -59,8 +59,6 @@ static inline float round(float x) { return floor(x + 0.5f); } #define clamp(a,b,c) (max(b, min(a, c))) #define rnd(max) (rand()%(max)) -#define rndreset() (srand(1)) -#define rndtime() { loopi(lastmillis&0xF) rnd(i+1); } #define detrnd(s, x) ((int)(((((uint)(s))*1103515245+12345)>>16)%(x))) #define loop(v,m) for(int v = 0; v