mirror of
https://github.com/godotengine/godot.git
synced 2024-11-25 05:33:11 +00:00
- Fix issue #802: randomize() now generate non-zero seed during the first hour of every days, the first minute of every hours and the first second of every minutes.
This commit is contained in:
parent
4e31faab4a
commit
5f2222ee89
@ -76,7 +76,7 @@ void Math::seed(uint32_t x) {
|
||||
void Math::randomize() {
|
||||
|
||||
OS::Time time = OS::get_singleton()->get_time();
|
||||
seed(OS::get_singleton()->get_ticks_usec()*time.hour*time.min*time.sec*rand()); /* *OS::get_singleton()->get_time().sec); // windows doesn't have get_time(), returns always 0 */
|
||||
seed(OS::get_singleton()->get_ticks_usec()*(time.hour+1)*(time.min+1)*(time.sec+1)*rand()); /* *OS::get_singleton()->get_time().sec); // windows doesn't have get_time(), returns always 0 */
|
||||
}
|
||||
|
||||
uint32_t Math::rand() {
|
||||
|
Loading…
Reference in New Issue
Block a user