<URL: http://bugs.freeciv.org/Ticket/Display.html?id=40207 >
> [EMAIL PROTECTED] - Sat May 31 20:26:20 2008]:
>
> Here's an alternative approach which side-steps the issue:
> stop messing around with dummy tiles entirely, and promote
> the city-centre effect to the same level as irrigation and
> farmland are applied.
>
> The auto-irrigation part is easy:
>
> case O_FOOD:
> - if (contains_special(tile.special, S_IRRIGATION)) {
> + /* The city center tile is auto-irrigated. */
> + if (tile_has_special(ptile, S_IRRIGATION)
> + || (NULL != pcity
> + && is_city_center(pcity, ptile)
> + && pterrain == pterrain->irrigation_result
> + && terrain_control.may_irrigate)) {
> prod += pterrain->irrigation_food_incr;
> }
> break;
This is certainly better than the dummy tile approach.
> The auto-farmland part would be implemented by editing
> effects.ruleset, and that's where we hit a snag -- as far
> as I can tell, there's currently no way to limit an effect
> to a tile with a city on it.
>
> It would presumably be possible to add this capability to
> the effects system, but I think it'd require a new top-level
> entry in universals_n -- the alternative would be to treat
> the presence of a city as a kind of VUT_SPECIAL, which probably
> won't go down too well.
>
> With this approach, all rulesets that support Farmland
> would need updating before they got auto-farmland working
> again, but that's no worse than the current situation.
>
> I can have a go at this for S2_2 and the trunk if it seems
> like a good idea. Would this approach, necessitating as it
> does adding a top-level entity to the effects system, be
> too disruptive for the 2.1 branch?
I think for 2.1 best would be a minimal hackfix using
a dummy tile just to get it working as expected, and
for 2.2+ to expand the effect system to allow support
for auto-irrigation and auto-farmland of the city center.
---------------------------------------------------------------------
思い出したわけないね、あの日。
_______________________________________________
Freeciv-dev mailing list
[email protected]
https://mail.gna.org/listinfo/freeciv-dev