Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2004:
[Freeciv-Dev] Re: (PR#9737) team (human+ai) causes problems when researc
Home

[Freeciv-Dev] Re: (PR#9737) team (human+ai) causes problems when researc

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: c02lek@xxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#9737) team (human+ai) causes problems when researching [freeciv #9737]
From: "Per I. Mathisen" <per@xxxxxxxxxxx>
Date: Thu, 19 Aug 2004 15:03:11 -0700
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=9737 >

On Thu, 19 Aug 2004, Mattias Linde wrote:
> On Thu, 19 Aug 2004, Per I. Mathisen wrote:
> >On Thu, 19 Aug 2004, Mattias Linde wrote:
> > > I'v found a problem with techs when in team with AI.

This patch should fix the problem. Not tested.

  - Per

Index: server/plrhand.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/plrhand.c,v
retrieving revision 1.317
diff -u -r1.317 plrhand.c
--- server/plrhand.c    14 Aug 2004 19:41:24 -0000      1.317
+++ server/plrhand.c    19 Aug 2004 22:02:07 -0000
@@ -453,11 +453,18 @@
         && plr->diplstates[aplayer->player_no].type == DS_TEAM
         && aplayer->is_alive
         && get_invention(aplayer, tech_found) != TECH_KNOWN) {
-      notify_player_ex(aplayer, -1, -1, E_TECH_LEARNED,
-                       _("Game: Learned %s in cooperation with %s. "
-                         "Scientists choose to research %s."),
-                       advances[tech_found].name, plr->name,
-                       get_tech_name(plr, plr->research.researching));
+      if (tech_exists(plr->research.researching)) {
+        notify_player_ex(aplayer, -1, -1, E_TECH_LEARNED,
+                         _("Game: Learned %s in cooperation with %s. "
+                           "Scientists choose to research %s."),
+                         advances[tech_found].name, plr->name,
+                         get_tech_name(plr, plr->research.researching));
+      } else {
+        notify_player_ex(aplayer, -1, -1, E_TECH_LEARNED,
+                         _("Game: Learned %s in cooperation with %s. "
+                           "Scientists do not know what to research next."),
+                         advances[tech_found].name, plr->name);
+      }
       found_new_tech(aplayer, tech_found, was_discovery, saving_bulbs,
                      plr->research.researching);
     }

[Prev in Thread] Current Thread [Next in Thread]