Complete.Org: Mailing Lists: Archives: freeciv-dev: October 2004:
[Freeciv-Dev] (PR#10676) get_city_bonus_sources ignores negative effects
Home

[Freeciv-Dev] (PR#10676) get_city_bonus_sources ignores negative effects

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] (PR#10676) get_city_bonus_sources ignores negative effects
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 21 Oct 2004 23:15:27 -0700
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=10676 >

get_city_bonus_sources will just skip over effects with negative values.

This isn't likely to be a problem for 2.0.0 since this function isn't 
used in many places.  However with a different ruleset it could give the 
wrong results.  This patch fixes it.

jason

Index: common/effects.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/effects.c,v
retrieving revision 1.14
diff -u -r1.14 effects.c
--- common/effects.c    10 Oct 2004 21:14:11 -0000      1.14
+++ common/effects.c    22 Oct 2004 06:13:48 -0000
@@ -1259,7 +1259,7 @@
 
   building_vector_iterate(get_buildings_with_effect(effect_type), pbldg) {
     if (get_effect_value(TARGET_CITY, pplayer, pcity,
-                        B_LAST, NULL, *pbldg, effect_type) > 0) {
+                        B_LAST, NULL, *pbldg, effect_type) != 0) {
       building_vector_append(&sources, pbldg);
     }
   } building_vector_iterate_end;

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#10676) get_city_bonus_sources ignores negative effects, Jason Short <=