12 #include "../stdafx.h"
17 #include "../network/network.h"
18 #include "../network/network_server.h"
19 #include "../network/network_internal.h"
20 #include "../company_func.h"
21 #include "../fileio_func.h"
22 #include "../date_func.h"
25 #include "../safeguards.h"
35 const uint32 s = this->
state[0];
36 const uint32 t = this->
state[1];
38 this->
state[0] = s +
ROR(t ^ 0x1234567F, 7) + 1;
39 return this->
state[1] =
ROR(s, 3) - 1;
50 return ((uint64)this->
Next() * (uint64)limit) >> 32;
59 this->
state[0] = seed;
60 this->
state[1] = seed;
70 _interactive_random.
SetSeed(seed * 0x1234567);
74 uint32 DoRandom(
int line,
const char *file)
76 if (
_networking && (!
_network_server || (NetworkClientSocket::IsValidID(0) && NetworkClientSocket::Get(0)->status != NetworkClientSocket::STATUS_INACTIVE))) {
80 return _random.
Next();
83 uint32 DoRandomRange(uint32 limit,
int line,
const char *file)
85 return ((uint64)DoRandom(line, file) * (uint64)limit) >> 32;