[Freeciv-Dev] (PR#8754) effects patch
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
<URL: http://rt.freeciv.org/Ticket/Display.html?id=8754 >
In this function:
+/**************************************************************************
+ Returns the effect sources of this type currently active at the city.
+**************************************************************************/
+struct building_vector get_city_bonus_sources(const struct city *pcity,
+ enum effect_type eff)
+{
+ struct player *plr = city_owner(pcity);
+ struct building_vector res;
+
+ building_vector_init(&res);
+
+ building_vector_iterate(get_buildings_with_effect(eff), pbldg) {
+ if (get_effect_value(TARGET_CITY, plr, pcity, B_LAST, NULL, *pbldg,
eff)) {+ building_vector_append(&res, pbldg);
+ }
+ } building_vector_iterate_end;
+
+ return res;
+}
memory is allocated, since a building vector is basically a pointer. It
must later be freed (presumably by the caller) via building_vector_free.
I doubt this is done (I didn't check), but even if it is this must be
documented in the header.
jason
- [Freeciv-Dev] (PR#8754) effects patch, (continued)
- [Freeciv-Dev] (PR#8754) effects patch, Vasco Alexandre da Silva Costa, 2004/08/03
- [Freeciv-Dev] (PR#8754) effects patch, Vasco Alexandre da Silva Costa, 2004/08/03
- [Freeciv-Dev] (PR#8754) effects patch, Jason Short, 2004/08/04
- [Freeciv-Dev] (PR#8754) effects patch, Jason Short, 2004/08/04
- [Freeciv-Dev] (PR#8754) effects patch, Jason Short, 2004/08/04
- [Freeciv-Dev] (PR#8754) effects patch, Jason Short, 2004/08/04
- [Freeciv-Dev] (PR#8754) effects patch, Vasco Alexandre da Silva Costa, 2004/08/04
- [Freeciv-Dev] (PR#8754) effects patch, Vasco Alexandre da Silva Costa, 2004/08/05
- [Freeciv-Dev] (PR#8754) effects patch, Jason Short, 2004/08/05
- [Freeciv-Dev] (PR#8754) effects patch, Jason Short, 2004/08/05
- [Freeciv-Dev] (PR#8754) effects patch,
Jason Short <=
- [Freeciv-Dev] (PR#8754) effects patch, Jason Short, 2004/08/05
- [Freeciv-Dev] (PR#8754) effects patch, Vasco Alexandre da Silva Costa, 2004/08/08
|
|