Sat 30 Jun 2012 10:53:06 AM UTC, comment #1:
> It seems to me that it could easily pass city_tile(pcity) and
> thus enable effects such as the above. Is there any reason not
> to do so?
It seems that these get_xxx_bonus() functions were originally written so that just the effects in our own rulesets would work, as opposed to make them more generic. I've considered such failures to pass obvious parameters as bugs in the past (fix for this one should certainly go to TRUNK and S2_4, I'm a bit undecided about S2_3: it would create incentive for ruleset authors to create rulesets that do not work in earlier 2.3.x releases)
> As usual with effects, the tricky part is edge conditions --
> whenever tile properties change, knock-on effects on all the
> above need to be reviewed.
That's one reason why Max_Trade_Routes is defined never to cause removal of existing traderoutes. I would just document the restrictions in the first phase. Passing the tile would anyway make it work better (in my view that failing to do so is a bug, not missing feature)
|
Sat 30 Jun 2012 10:33:47 AM UTC, original submission:
In bug #16308 (comment 5), David Fernandez complains:
'When I use the requeriment "Special", "River", "Adjacent" in my rulesets, it seems to return always false, even when the city is placed near or over a river.
'This code from effects.ruleset never works (it is supposed to give aqueduct bonus in cities near rivers):'
I've confimed this. The reason seems simple: get_city_bonus() passes the tile argument of get_target_bonus_effects() as NULL.
It seems to me that it could easily pass city_tile(pcity) and thus enable effects such as the above. Is there any reason not to do so?
I believe this affects the following effects:
- Capital_City, Gov_Center
- Size_Adj, Size_Unlimit
- Growth_Food
- Rapture_Grow
- City_Radius_Sq, City_Vision_Radius_Sq
- Health_Pct
- Migration_Pct
- Trade_Revenue_Bonus, Max_Trade_Routes
- Pollu_Prod_Pct
- City_Build_Slots
- Airlift
- Happiness_To_Gold
- Make_Content_Mil_Per, Make_Content_Mil
- Martial_Law_Each, Martial_Law_Max
- Make_Happy, No_Unhappy, Make_Content, Force_Content
- Unhappy_Factor
- Defend_Bonus
- Visible_Walls, City_Image
- Unit_No_Lose_Pop
- Nuke_Proof
- Incite_Cost_Pct, No_Incite, Spy_Resistant
- HP_Regen
(As usual with effects, the tricky part is edge conditions -- whenever tile properties change, knock-on effects on all the above need to be reviewed. Perhaps that will mostly Just Work, but I guess it needs an audit.)
|