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

Binary file not shown.

Binary file not shown.