Complete.Org: Mailing Lists: Archives: freeciv-dev: January 2002:
[Freeciv-Dev] Re: Assertion failed: missing > 0, file plrhand.c, line 38
Home

[Freeciv-Dev] Re: Assertion failed: missing > 0, file plrhand.c, line 38

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Paul Zastoupil <paulz@xxxxxxxxxxxx>
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: Assertion failed: missing > 0, file plrhand.c, line 383
From: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 16 Jan 2002 23:36:45 +0100
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxx

On Wed, Jan 16, 2002 at 09:35:38AM -0800, Paul Zastoupil wrote:
> Attached.  Log in as paulz and start.  Its an all AI game.

Problem: researching the A_NONE tech costs 0 bulbs. A_NONE is used to
indicate "research the next future tech". Note that this isn't the
only way to specify a future tech (this would too easy). See the new
is_future_tech() function. I'm getting the impression that the tech
system is/was in a similar shape than the map system. So the fix for
the actual bug is:

-  if (get_invention(pplayer, tech) == TECH_KNOWN) {
+  if (!is_future_tech(tech) && get_invention(pplayer, tech) == TECH_KNOWN) {
+    /* A non-future tech which is already known costs nothing. */
     return 0;
   }

The other 15k reduce duplicate code and propagate is_future_tech()
through the code base.


Please test.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "We just typed make..."
    -- Stephen Lambrigh, Director of Server Product Marketing at Informix,
                         about porting their Database to Linux

Attachment: future_fix1.diff
Description: Text document


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