Complete.Org: Mailing Lists: Archives: freeciv-dev: January 2006:
[Freeciv-Dev] (PR#15137) end-game problems
Home

[Freeciv-Dev] (PR#15137) end-game problems

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] (PR#15137) end-game problems
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 10 Jan 2006 17:28:33 -0800
Reply-to: bugs@xxxxxxxxxxx

<URL: http://bugs.freeciv.org/Ticket/Display.html?id=15137 >

This patch fixes several end-game problems, particularly related to GGZ 
mode:

- Removes assertions from GGZ code (with explanations).
- Adds surrender support to victor checking in GGZ code.
- Don't double-report victories for /surrender.

The last is a quick fix for PR#15135, but may not be the best fix so 
I'll leave that ticket open.

Since these are all fairly critical bugs I will commit this immediately.

-jason

Index: server/srv_main.c
===================================================================
--- server/srv_main.c   (revision 11432)
+++ server/srv_main.c   (working copy)
@@ -305,7 +305,8 @@
       notify_conn(game.est_connections, NULL, E_GAME_END,
                     _("Team victory to %s"), team_get_name_orig(pteam));
       players_iterate(pplayer) {
-       if (pplayer->is_alive) {
+       if (pplayer->is_alive
+           && !pplayer->surrendered) {
          ggz_report_victor(pplayer);
        }
       } players_iterate_end;
Index: server/ggzserver.c
===================================================================
--- server/ggzserver.c  (revision 11432)
+++ server/ggzserver.c  (working copy)
@@ -273,7 +273,7 @@
        int seat = get_seat_for_player(pplayer);
 
        if (seat < 0) {
-         assert(0);
+         /* FIXME: this can happen for AI players */
        } else {
          teams[get_seat_for_player(pplayer)] = num_teams;
        }
@@ -319,7 +319,7 @@
     int seat_num = get_seat_for_player(victors[i]);
 
     if (seat_num < 0) {
-      assert(0);
+      /* FIXME: this can happen for AI players */
     } else {
       results[seat_num] = GGZ_GAME_WIN;
     }
Index: server/stdinhand.c
===================================================================
--- server/stdinhand.c  (revision 11432)
+++ server/stdinhand.c  (working copy)
@@ -3636,9 +3636,6 @@
                    _("%s has conceded the game and can no longer win."),
                    caller->player->name);
     caller->player->surrendered = TRUE;
-    if (check_for_game_over()) {
-      force_end_of_sniff = TRUE;
-    }
     return TRUE;
   } else {
     cmd_reply(CMD_END_GAME, caller, C_FAIL, _("You cannot surrender now."));

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#15137) end-game problems, Jason Short <=