Complete.Org: Mailing Lists: Archives: freeciv-dev: June 2005:
[Freeciv-Dev] (PR#13360) Choose random tech and future tech
Home

[Freeciv-Dev] (PR#13360) Choose random tech and future tech

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] (PR#13360) Choose random tech and future tech
From: "Mateusz Stefek" <mstefek@xxxxxxxxx>
Date: Tue, 28 Jun 2005 13:12:04 -0700
Reply-to: bugs@xxxxxxxxxxx

<URL: http://bugs.freeciv.org/Ticket/Display.html?id=13360 >

 
> > I don't know if get_invention() can be called on A_FUTURE
> > at least in CVS it returns TECH_UNKNOWN
I'm not sure if TECH_UNKNOWN, but surely something != TECH_RESEARCHABLE
There is no special case for A_FUTURE in update_research
 
> Really?  Seems like that's the bug.
> 
> Note that it *should* return TECH_UNKNOWN if all techs haven't been
> discovered.
> 
> -jason
> 
enum tech_state get_invention(const struct player *pplayer,
                              Tech_type_id tech)
{
  assert(tech >= 0 || tech < game.control.num_tech_types);

  return get_player_research(pplayer)->inventions[tech].state;
}

I think the author intended the function to be called only with real 
techs, but he messed the assertion and for a very long time everything
looked ok. (Till now)

--
mateusz



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