Complete.Org: Mailing Lists: Archives: freeciv-dev: April 2005:
[Freeciv-Dev] Re: (PR#12810) xaw client worlklist dialog does not show u
Home

[Freeciv-Dev] Re: (PR#12810) xaw client worlklist dialog does not show u

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: infyquest@xxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#12810) xaw client worlklist dialog does not show units that can be produced
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 15 Apr 2005 21:23:43 -0700
Reply-to: bugs@xxxxxxxxxxx

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

Vijay Kiran Kamuju wrote:
> <URL: http://bugs.freeciv.org/Ticket/Display.html?id=12810 >
> 
> Hi,
> xaw client cvs 14-04-05 5:00 pm IST, i cannot see any settlers or guards 
> that an be built when i start a game,
> I start a game, i make a city 
> when i go to worklist after the turn, and want to create settlers, i cannot 
> find them there, only buildings are there
> if want them to show future/advanced its showing the settlers, guards, 
> phalanx, etc

Thanks for the report.  I don't know how that error got through.  Here's 
a fix.

-jason

Index: common/unittype.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/unittype.c,v
retrieving revision 1.53
diff -u -r1.53 unittype.c
--- common/unittype.c   14 Apr 2005 04:49:14 -0000      1.53
+++ common/unittype.c   16 Apr 2005 04:22:33 -0000
@@ -396,6 +396,8 @@
 **************************************************************************/
 bool can_player_build_unit_direct(const struct player *p, Unit_Type_id id)
 {
+  Impr_Type_id impr_req;
+
   CHECK_UNIT_TYPE(id);
   if (unit_type_flag(id, F_NUCLEAR)
       && !get_player_bonus(p, EFT_ENABLE_NUKE) > 0) {
@@ -429,8 +431,9 @@
   /* If the unit has a building requirement, we check to see if the player
    * can build that building.  Note that individual cities may not have
    * that building, so they still may not be able to build the unit. */
-  if (!can_player_build_improvement_direct(p,
-                                          unit_types[id].impr_requirement)) {
+  impr_req = unit_types[id].impr_requirement;
+  if (impr_req != B_LAST
+      && !can_player_build_improvement_direct(p, impr_req)) {
     return FALSE;
   }
 

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] Re: (PR#12810) xaw client worlklist dialog does not show units that can be produced, Jason Short <=