From 3f8bd998dcc6d592ffd5d3aefad06f0bbf28a725 Mon Sep 17 00:00:00 2001 From: Ray Strode Date: Fri, 8 Jun 2012 16:52:29 -0400 Subject: [PATCH] script: seed random number generator Most splash plugins that use random numbers seed the random number generator with the current time, but script fails, too. This commit fixes that. https://bugs.freedesktop.org/show_bug.cgi?id=42632 --- src/plugins/splash/script/script-lib-math.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/plugins/splash/script/script-lib-math.c b/src/plugins/splash/script/script-lib-math.c index 383fe46f..a1afc041 100644 --- a/src/plugins/splash/script/script-lib-math.c +++ b/src/plugins/splash/script/script-lib-math.c @@ -65,6 +65,8 @@ script_lib_math_data_t *script_lib_math_setup (script_state_t *state) { script_lib_math_data_t *data = malloc (sizeof (script_lib_math_data_t)); + srand ((int) ply_get_timestamp ()); + script_obj_t *math_hash = script_obj_hash_get_element (state->global, "Math"); script_add_native_function (math_hash, "Cos", -- 2.47.3