Author: cazfi Date: Sun Nov 1 18:55:18 2015 New Revision: 30354 URL: http://svn.gna.org/viewcvs/freeciv?rev=30354&view=rev Log: Work around a problem of defense bonus originating from a source not counting as 'wall', in the default AI terminology, reducing defender want.
See bug #23997 Modified: branches/S2_6/ai/default/advmilitary.c Modified: branches/S2_6/ai/default/advmilitary.c URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/ai/default/advmilitary.c?rev=30354&r1=30353&r2=30354&view=diff ============================================================================== --- branches/S2_6/ai/default/advmilitary.c (original) +++ branches/S2_6/ai/default/advmilitary.c Sun Nov 1 18:55:18 2015 @@ -795,9 +795,15 @@ int limit_cost = pcity->shield_stock + 40; if (walls && !utype_has_flag(punittype, UTYF_BADCITYDEFENDER)) { - desire *= city_data->wallvalue; - /* TODO: More use of POWER_FACTOR ! */ - desire /= POWER_FACTOR; + /* FIXME: Below if() is just workaround to make sure desire + * is not made zero when 'walls' above is not actually + * walls that increase wallvalue, but misdiagnosed + * because of some other defense bonus the city gets. */ + if (city_data->wallvalue > POWER_FACTOR) { + desire *= city_data->wallvalue; + /* TODO: More use of POWER_FACTOR ! */ + desire /= POWER_FACTOR; + } } if ((best_unit_cost > limit_cost _______________________________________________ Freeciv-commits mailing list Freeciv-commits@gna.org https://mail.gna.org/listinfo/freeciv-commits