Fix RNG seed for web

Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
master
sigonasr2 2 years ago
parent 102d20e946
commit 6e36707eda
  1. 9
      SeasonsOfLoneliness.cpp
  2. BIN
      Seasons_of_Loneliness
  3. BIN
      Seasons_of_Loneliness.wasm

@ -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.
Loading…
Cancel
Save