[Freeciv-Dev] (PR#12956) City style crash
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
<URL: http://bugs.freeciv.org/Ticket/Display.html?id=12956 >
And a patch.
-jason
Index: server/srv_main.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/srv_main.c,v
retrieving revision 1.252
diff -u -r1.252 srv_main.c
--- server/srv_main.c 2 May 2005 10:37:18 -0000 1.252
+++ server/srv_main.c 4 May 2005 06:49:03 -0000
@@ -1656,10 +1656,9 @@
con_flush();
- game_init();
+ server_game_init();
stdinhand_init();
diplhand_init();
- load_rulesets(); /* May be reloaded later if the rulesetdir is changed. */
/* init network */
init_connections();
@@ -1714,7 +1713,7 @@
/* Reset server */
server_game_free();
- game_init();
+ server_game_init();
game.is_new_game = TRUE;
server_state = PRE_GAME_STATE;
}
@@ -1958,6 +1957,18 @@
}
/**************************************************************************
+ Initialize game data for the server (corresponds to server_game_free).
+**************************************************************************/
+void server_game_init(void)
+{
+ game_init();
+
+ /* Rulesets are loaded on game initialization, but may be changed later
+ * if /load or /rulesetdir is done. */
+ load_rulesets();
+}
+
+/**************************************************************************
Free game data that we reinitialize as part of a server soft restart.
Bear in mind that this function is called when the 'load' command is
used, for instance.
Index: server/srv_main.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/srv_main.h,v
retrieving revision 1.31
diff -u -r1.31 srv_main.h
--- server/srv_main.h 2 May 2005 10:37:18 -0000 1.31
+++ server/srv_main.h 4 May 2005 06:49:03 -0000
@@ -66,6 +66,7 @@
void dealloc_id(int id);
void alloc_id(int id);
int get_next_id_number(void);
+void server_game_init(void);
void server_game_free(void);
void check_for_full_turn_done(void);
|
|