Author: sveinung
Date: Mon Mar 30 00:36:59 2015
New Revision: 28657

URL: http://svn.gna.org/viewcvs/freeciv?rev=28657&view=rev
Log:
Don't declare an already researched tech unreachable.

An already researched tech is reachable even if it no longer is possible to
research one of the techs that must be researched before it can be researched.

See bug #23425

Modified:
    trunk/common/research.c

Modified: trunk/common/research.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/common/research.c?rev=28657&r1=28656&r2=28657&view=diff
==============================================================================
--- trunk/common/research.c     (original)
+++ trunk/common/research.c     Mon Mar 30 00:36:59 2015
@@ -348,8 +348,13 @@
   /* Check that all recursive requirements have their research_reqs
    * in order. */
   for (i = 0; i < techs_num; i++) {
-    if (presearch->inventions[techs[i]].state != TECH_KNOWN
-        && !research_is_allowed(presearch, techs[i])) {
+    if (presearch->inventions[techs[i]].state == TECH_KNOWN) {
+      /* This tech is already reached. What is required to research it and
+       * the techs it depends on is therefore irrelevant. */
+      continue;
+    }
+
+    if (!research_is_allowed(presearch, techs[i])) {
       /* It is currently illegal to start researching this tech. Since
        * only unchanging requirements are allowed the situation will
        * continue. Since it isn't already known and can't be researched


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

Reply via email to