summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2014-10-27 22:43:19 -0300
committerJuan Linietsky <reduzio@gmail.com>2014-10-27 22:43:19 -0300
commitb42ced68e8cfe316d7bcd016f7f889485c596573 (patch)
tree6a639505b3364de6d285dbdd15b32d27047fe2f8
parentbde9528a847c4e0301fea509f815e6642245be8a (diff)
parent5f2222ee8932171fbd22ddcfdbda93e8143eb1cf (diff)
Merge pull request #829 from grabiller/#802
Fix issue #802: randomize() now generate non-zero seed...
-rw-r--r--core/math/math_funcs.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/math/math_funcs.cpp b/core/math/math_funcs.cpp
index 92236a374f..ad48ceaac0 100644
--- a/core/math/math_funcs.cpp
+++ b/core/math/math_funcs.cpp
@@ -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() {