replace rand() and srand(). fix #390

This commit is contained in:
2024-08-07 13:14:56 -05:00
committed by Celtic Minstrel
parent a1022aa23b
commit fc12092a1b
6 changed files with 16 additions and 9 deletions

View File

@@ -343,16 +343,16 @@ void init_boe(int argc, char* argv[]) {
Element& srand_element = pop_next_action("srand");
std::string ts(srand_element.GetText());
srand(atoi(ts.c_str()));
game_rand.seed(atoi(ts.c_str()));
} else {
auto t = time(nullptr);
if (recording) {
std::string ts = boost::lexical_cast<std::string>(t);
record_action("srand", ts);
}
srand(t);
game_rand.seed(t);
}
std::cout << rand() << std::endl;
std::cout << game_rand() << std::endl;
init_screen_locs();
init_startup();
flushingInput = true;