Fix RNG seed for web

Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
This commit is contained in:
sigonasr2 2022-08-30 21:51:26 -05:00
parent 102d20e946
commit 6e36707eda
3 changed files with 6 additions and 3 deletions

View File

@ -425,7 +425,7 @@ public:
int PLAYER_HP=PLAYER_MAXHP;
int BATTLE_CURRENT_TURN_ENTITY=-1;
int CURRENT_ENCOUNTER_IND=-1;
int RAND_CALLS=0;
unsigned int RAND_CALLS=0;
std::vector<DisplayNumber*> BATTLE_DISPLAY_NUMBERS;
bool PLAYER_TURN_COMPLETE=false;
int FOOD_REGEN_TURNS=0;
@ -705,6 +705,7 @@ public:
while (elapsedTime>TARGET_RATE) {
elapsedTime-=TARGET_RATE;
updateGame();
rand();
}
if (GetKey(F1).bPressed) {
ConsoleShow(F1,false);
@ -2060,8 +2061,10 @@ public:
}
int rand() {
srand(time(NULL)+RAND_CALLS++);
return std::rand();
srand(time(NULL)+RAND_CALLS);
int randNumb = std::rand();
RAND_CALLS=randNumb;
return randNumb;
}
void performCropUpdate(int chanceToRegrow) {

Binary file not shown.

Binary file not shown.