Author: cazfi
Date: Tue Dec  9 20:25:57 2014
New Revision: 27218

URL: http://svn.gna.org/viewcvs/freeciv?rev=27218&view=rev
Log:
Initialize random number generator for modpack installers.

See bug #22966

Modified:
    branches/S2_5/tools/mpcli.c
    branches/S2_5/tools/mpgui_gtk2.c
    branches/S2_5/tools/mpgui_gtk3.c
    branches/S2_5/tools/mpgui_qt.cpp

Modified: branches/S2_5/tools/mpcli.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_5/tools/mpcli.c?rev=27218&r1=27217&r2=27218&view=diff
==============================================================================
--- branches/S2_5/tools/mpcli.c (original)
+++ branches/S2_5/tools/mpcli.c Tue Dec  9 20:25:57 2014
@@ -23,6 +23,7 @@
 #include "log.h"
 #include "mem.h"
 #include "netintf.h"
+#include "rand.h"
 #include "registry.h"
 #include "shared.h"
 
@@ -108,6 +109,7 @@
   fc_init_network();
 
   log_init(NULL, loglevel, NULL, NULL, -1);
+  fc_srand(time(NULL)); /* Needed at least for Windows version of 
netfile_get_section_file() */
 
   /* This modifies argv! */
   ui_options = fcmp_parse_cmdline(argc, argv);

Modified: branches/S2_5/tools/mpgui_gtk2.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_5/tools/mpgui_gtk2.c?rev=27218&r1=27217&r2=27218&view=diff
==============================================================================
--- branches/S2_5/tools/mpgui_gtk2.c    (original)
+++ branches/S2_5/tools/mpgui_gtk2.c    Tue Dec  9 20:25:57 2014
@@ -25,6 +25,7 @@
 #include "log.h"
 #include "mem.h"
 #include "netintf.h"
+#include "rand.h"
 #include "registry.h"
 #include "shared.h"
 
@@ -573,6 +574,7 @@
   g_thread_init(NULL);
 
   log_init(NULL, loglevel, NULL, NULL, -1);
+  fc_srand(time(NULL)); /* Needed at least for Windows version of 
netfile_get_section_file() */
 
   /* This modifies argv! */
   ui_options = fcmp_parse_cmdline(argc, argv);

Modified: branches/S2_5/tools/mpgui_gtk3.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_5/tools/mpgui_gtk3.c?rev=27218&r1=27217&r2=27218&view=diff
==============================================================================
--- branches/S2_5/tools/mpgui_gtk3.c    (original)
+++ branches/S2_5/tools/mpgui_gtk3.c    Tue Dec  9 20:25:57 2014
@@ -25,6 +25,7 @@
 #include "log.h"
 #include "mem.h"
 #include "netintf.h"
+#include "rand.h"
 #include "registry.h"
 #include "shared.h"
 
@@ -579,6 +580,7 @@
   fc_init_network();
 
   log_init(NULL, loglevel, NULL, NULL, -1);
+  fc_srand(time(NULL)); /* Needed at least for Windows version of 
netfile_get_section_file() */
 
   /* This modifies argv! */
   ui_options = fcmp_parse_cmdline(argc, argv);

Modified: branches/S2_5/tools/mpgui_qt.cpp
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_5/tools/mpgui_qt.cpp?rev=27218&r1=27217&r2=27218&view=diff
==============================================================================
--- branches/S2_5/tools/mpgui_qt.cpp    (original)
+++ branches/S2_5/tools/mpgui_qt.cpp    Tue Dec  9 20:25:57 2014
@@ -32,6 +32,7 @@
 #include "fcintl.h"
 #include "log.h"
 #include "netintf.h"
+#include "rand.h"
 #include "registry.h"
 
 // common
@@ -88,6 +89,7 @@
   registry_module_init();
   fc_init_network();
   log_init(NULL, loglevel, NULL, NULL, -1);
+  fc_srand(time(NULL)); // Needed at least for Windows version of 
netfile_get_section_file()
 
   /* This modifies argv! */
   ui_options = fcmp_parse_cmdline(argc, argv);


_______________________________________________
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits

Reply via email to