Complete.Org: Mailing Lists: Archives: freeciv-dev: February 2003:
[Freeciv-Dev] (PR#3484) diplomacy dialog tech bug
Home

[Freeciv-Dev] (PR#3484) diplomacy dialog tech bug

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients:;
Subject: [Freeciv-Dev] (PR#3484) diplomacy dialog tech bug
From: "Per I. Mathisen" <per@xxxxxxxxxxx>
Date: Thu, 20 Feb 2003 15:08:04 -0800
Reply-to: rt@xxxxxxxxxxxxxx

This bug is difficult to create, since it requires a specific pattern of
behaviour from three players, but it is still annoying when it happens.
Two players open up a diplomacy dialog to a third player and suggest to
give him the same tech before either has time to press Accept. When one
pressed Accept, the diplomacy dialog of the other is not updated with the
info that third player now has this tech, so when we give it to him again,
it triggers an assert.

The attached patch disregards such superfluous tech instead of doing a
core dump. Going to all the bother of updating the diplomacy dialog for
such rare cases is overkill, in my opinion, and it gives players no real
useful information.

  - Per

Index: server/diplhand.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/diplhand.c,v
retrieving revision 1.65
diff -u -r1.65 diplhand.c
--- server/diplhand.c   2002/11/15 21:24:30     1.65
+++ server/diplhand.c   2003/02/20 22:43:18
@@ -288,6 +288,12 @@
 
       switch (pclause->type) {
       case CLAUSE_ADVANCE:
+        /* It is possible that two players open the diplomacy dialog
+         * and try to give us the same tech at the same time. This
+         * should be handled discreetly instead of giving a core dump. */
+        if (get_invention(pdest, pclause->value) == TECH_KNOWN) {
+          break;
+        }
        notify_player_ex(pdest, -1, -1, E_TECH_GAIN,
                         _("Game: You are taught the knowledge of %s."),
                         get_tech_name(pdest, pclause->value));

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#3484) diplomacy dialog tech bug, Per I. Mathisen <=