Complete.Org: Mailing Lists: Archives: freeciv-dev: December 2005:
[Freeciv-Dev] Re: (PR#14768) capitalization unavailable
Home

[Freeciv-Dev] Re: (PR#14768) capitalization unavailable

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: badamson@xxxxxxxxxxx, chrisk@xxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#14768) capitalization unavailable
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 14 Dec 2005 01:37:35 -0800
Reply-to: bugs@xxxxxxxxxxx

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

John Bauman wrote:

>><URL: http://bugs.freeciv.org/Ticket/Display.html?id=14768 >
>>
>>>[badamson@xxxxxxxxxxx - Tue Dec 13 22:39:16 2005]:
>>>
>>>Using SVN revision 11344 the entry for Coinage in the city production 
>>>dialogue is struck out, suggesting that it is unavailable.
>>>
>>>This presumably indicates that some predicate function is returning 
>>>FALSE instead of TRUE. This might confuse the AI.
>>
>>Known bug.  Patch wanted.  Should be an easy fix.
>>
> 
> What was wrong with Vasco's patch?

Oops, I missed that one.  But I think it's wrong...a building with no 
effects is *always* redundant.  And a building that provides 
capitalization along with other effects, but those other effects are all 
replaced, is *not* redundant. I think this patch is the correct way to 
do it.

-jason

Index: common/effects.c
===================================================================
--- common/effects.c    (revision 11348)
+++ common/effects.c    (working copy)
@@ -685,11 +685,16 @@
   source.type = REQ_BUILDING;
   source.value.building = building;
 
+  /* A capitalization production is never redundant. */
+  if (impr_flag(building, IF_GOLD)) {
+    return FALSE;
+  }
+
   plist = get_req_source_effects(&source);
 
-  /* A building that has no effects is never redundant. */
+  /* A building with no effects and no flags is always redundant! */
   if (!plist) {
-    return FALSE;
+    return TRUE;
   }
 
   effect_list_iterate(plist, peffect) {

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