[Freeciv-Dev] Re: (PR#12439) Timer 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=12439 >
Per I. Mathisen wrote:
> <URL: http://bugs.freeciv.org/Ticket/Display.html?id=12439 >
>
> civserver: timing.c:370: read_timer_seconds: Assertion `t != ((void *)0)'
> failed.
My mistake. The check is for "game.timeout != 0" but should be
"game.timeout > 0". This patch should fix it.
-jason
Index: server/gamehand.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/gamehand.c,v
retrieving revision 1.154
diff -u -r1.154 gamehand.c
--- server/gamehand.c 5 Mar 2005 00:06:25 -0000 1.154
+++ server/gamehand.c 6 Mar 2005 00:26:23 -0000
@@ -345,7 +345,7 @@
ginfo.great_wonders[i] = game.great_wonders[i];
/* the following values are computed every
time a packet_game_info packet is created */
- if (game.timeout != 0) {
+ if (game.timeout > 0) {
ginfo.seconds_to_phasedone
= game.seconds_to_phase_done - read_timer_seconds(game.phase_timer);
} else {
@@ -423,7 +423,7 @@
**************************************************************************/
void increase_timeout_because_unit_moved(void)
{
- if (game.timeout != 0 && game.timeoutaddenemymove > 0) {
+ if (game.timeout > 0 && game.timeoutaddenemymove > 0) {
double maxsec = (read_timer_seconds(game.phase_timer)
+ (double)game.timeoutaddenemymove);
Index: server/sernet.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/sernet.c,v
retrieving revision 1.135
diff -u -r1.135 sernet.c
--- server/sernet.c 5 Mar 2005 00:06:26 -0000 1.135
+++ server/sernet.c 6 Mar 2005 00:26:23 -0000
@@ -499,7 +499,7 @@
if(select(max_desc+1, &readfs, &writefs, &exceptfs, &tv)==0) { /* timeout
*/
(void) send_server_info_to_metaserver(META_REFRESH);
- if (game.timeout != 0
+ if (game.timeout > 0
&& read_timer_seconds(game.phase_timer) > game.seconds_to_phase_done
&& server_state == RUN_GAME_STATE) {
con_prompt_off();
@@ -670,7 +670,7 @@
}
con_prompt_off();
- if (game.timeout != 0
+ if (game.timeout > 0
&& read_timer_seconds(game.phase_timer) > game.seconds_to_phase_done) {
return 0;
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Freeciv-Dev] Re: (PR#12439) Timer crash,
Jason Short <=
|
|