Author: cazfi
Date: Sat Nov  7 09:47:30 2015
New Revision: 30455

URL: http://svn.gna.org/viewcvs/freeciv?rev=30455&view=rev
Log:
Tell name of the tech gained as a bonus tech when one is first to research 
certain another tech.

Reported anonymously

See bug #23402

Modified:
    branches/S2_5/server/techtools.c

Modified: branches/S2_5/server/techtools.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_5/server/techtools.c?rev=30455&r1=30454&r2=30455&view=diff
==============================================================================
--- branches/S2_5/server/techtools.c    (original)
+++ branches/S2_5/server/techtools.c    Sat Nov  7 09:47:30 2015
@@ -319,7 +319,7 @@
   }
 
   if (was_first && tech_found != A_FUTURE
-   && advance_has_flag(tech_found, TF_BONUS_TECH)) {
+      && advance_has_flag(tech_found, TF_BONUS_TECH)) {
     bonus_tech_hack = TRUE;
   }
   
@@ -414,17 +414,26 @@
   }
 
   if (bonus_tech_hack) {
+    Tech_type_id additional_tech;
+
+    additional_tech = give_immediate_free_tech(plr);
+    
     if (advance_by_number(tech_found)->bonus_message) {
       notify_research(plr, E_TECH_GAIN, ftc_server,
                       "%s", _(advance_by_number(tech_found)->bonus_message));
-    } else {
+      if (additional_tech != A_UNSET) {
+        notify_research(plr, E_TECH_GAIN, ftc_server,
+                        /* TRANS: Got free tech. */
+                        _("Acquired %s"),
+                        advance_name_for_player(plr, additional_tech));
+      }
+    } else if (additional_tech != A_UNSET) {
       notify_research(plr, E_TECH_GAIN, ftc_server,
                       _("Great scientists from all the "
-                        "world join your civilization: you get "
-                        "an immediate advance."));
-    }
-
-    give_immediate_free_tech(plr);
+                        "world join your civilization: you learn "
+                        "%s immediately."),
+                      advance_name_for_player(plr, additional_tech));
+    }
   }
 
   /*


_______________________________________________
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits

Reply via email to