[Freeciv-commits] r25270 - /trunk/ai/default/aiunit.c
Author: persia Date: Thu Jun 26 11:11:00 2014 New Revision: 25270 URL: http://svn.gna.org/viewcvs/freeciv?rev=25270view=rev Log: Fix reversed logic in dai_is_unit_tired_waiting_boat See patch #4839 Modified: trunk/ai/default/aiunit.c Modified: trunk/ai/default/aiunit.c URL: http://svn.gna.org/viewcvs/freeciv/trunk/ai/default/aiunit.c?rev=25270r1=25269r2=25270view=diff == --- trunk/ai/default/aiunit.c (original) +++ trunk/ai/default/aiunit.c Thu Jun 26 11:11:00 2014 @@ -1942,7 +1942,6 @@ struct tile *src = NULL, *dest = NULL, *src_home_city = NULL; struct city *phome_city = NULL; struct unit_ai *unit_data = def_ai_unit_data(punit, ait); - bool required_boat = FALSE; if ((unit_data-task != AIUNIT_NONE)) { src = unit_tile(punit); @@ -1960,9 +1959,7 @@ return FALSE; } -required_boat = goto_is_sane(punit, dest); - -if (required_boat) { +if (!goto_is_sane(punit, dest)) { if (unit_transported(punit)) { /* if we're being transported */ return FALSE; ___ Freeciv-commits mailing list Freeciv-commits@gna.org https://mail.gna.org/listinfo/freeciv-commits
[Freeciv-commits] r25271 - in /trunk: ai/default/aiunit.c ai/default/aiunit.h common/unittype.c common/unittype.h
Author: persia Date: Thu Jun 26 11:11:09 2014 New Revision: 25271 URL: http://svn.gna.org/viewcvs/freeciv?rev=25271view=rev Log: Use gen-move compatible bodyguard filter Add caching of relevant unit_class and unit_type checks See patch #4649 Modified: trunk/ai/default/aiunit.c trunk/ai/default/aiunit.h trunk/common/unittype.c trunk/common/unittype.h Modified: trunk/ai/default/aiunit.c URL: http://svn.gna.org/viewcvs/freeciv/trunk/ai/default/aiunit.c?rev=25271r1=25270r2=25271view=diff == --- trunk/ai/default/aiunit.c (original) +++ trunk/ai/default/aiunit.c Thu Jun 26 11:11:09 2014 @@ -676,10 +676,10 @@ and building want estimation code. Returns desirability for using this unit as a bodyguard or for defending a city. - We do not consider units with higher movement than us, or units that have - different move type than us, as potential charges. Nor do we attempt to - bodyguard units with higher defence than us, or military units with higher - attack than us. + We do not consider units with higher movement than us, or units that are + native to terrains or extras not native to us, as potential charges. Nor + do we attempt to bodyguard units with higher defence than us, or military + units with lower attack than us that are not transports. / int look_for_charge(struct ai_type *ait, struct player *pplayer, struct unit *punit, @@ -693,6 +693,7 @@ int def, best_def = -1; /* Arbitrary: 3 turns. */ const int max_move_cost = 3 * unit_move_rate(punit); + struct unit_type_ai *utai = utype_ai_data(unit_type(punit), ait); *aunit = NULL; *acity = NULL; @@ -716,16 +717,24 @@ /* Consider unit bodyguard. */ unit_list_iterate(ptile-units, buddy) { + bool acceptable_charge = FALSE; + + unit_type_list_iterate(utai-potential_charges, charge_type) { +if (unit_type(punit) == charge_type) { + acceptable_charge = TRUE; +} + } unit_type_list_iterate_end; + /* TODO: allied unit bodyguard? */ - if (unit_owner(buddy) != pplayer + if (!acceptable_charge + || unit_owner(buddy) != pplayer || !aiguard_wanted(ait, buddy) || unit_move_rate(buddy) unit_move_rate(punit) || DEFENCE_POWER(buddy) = DEFENCE_POWER(punit) || (is_military_unit(buddy) 0 == get_transporter_capacity(buddy) - ATTACK_POWER(buddy) = ATTACK_POWER(punit)) - || (uclass_move_type(unit_class(buddy)) - != uclass_move_type(unit_class(punit { + ATTACK_POWER(buddy) = ATTACK_POWER(punit))) { + continue; } @@ -2964,6 +2973,7 @@ utai-ferry = FALSE; utai-missile_platform = FALSE; utai-carries_occupiers = FALSE; +utai-potential_charges = unit_type_list_new(); utype_set_ai_data(ptype, ait, utai); } unit_type_iterate_end; @@ -3012,6 +3022,29 @@ } } unit_class_iterate_end; } + +/* Consider potential charges */ +unit_type_iterate(pcharge) { + bool can_move_like_charge = FALSE; + + if (0 utype_fuel(punittype) + (0 == utype_fuel(pcharge) + || utype_fuel(pcharge) utype_fuel(punittype))) { +continue; + } + + unit_class_list_iterate(pclass-cache.subset_movers, chgcls) { +if (chgcls == utype_class(pcharge)) { + can_move_like_charge = TRUE; +} + } unit_class_list_iterate_end; + + if (can_move_like_charge) { +struct unit_type_ai *utai = utype_ai_data(punittype, ait); +unit_type_list_append(utai-potential_charges, pcharge); + } + +} unit_type_iterate_end; } unit_type_iterate_end; } Modified: trunk/ai/default/aiunit.h URL: http://svn.gna.org/viewcvs/freeciv/trunk/ai/default/aiunit.h?rev=25271r1=25270r2=25271view=diff == --- trunk/ai/default/aiunit.h (original) +++ trunk/ai/default/aiunit.h Thu Jun 26 11:11:09 2014 @@ -51,6 +51,7 @@ bool ferry; bool missile_platform; bool carries_occupiers; + struct unit_type_list *potential_charges; }; /* Simple military macros */ Modified: trunk/common/unittype.c URL: http://svn.gna.org/viewcvs/freeciv/trunk/common/unittype.c?rev=25271r1=25270r2=25271view=diff == --- trunk/common/unittype.c (original) +++ trunk/common/unittype.c Thu Jun 26 11:11:09 2014 @@ -1119,6 +1119,7 @@ unit_classes[i].item_number = i; unit_classes[i].cache.refuel_bases = NULL; unit_classes[i].cache.native_tile_extras = NULL; +unit_classes[i].cache.subset_movers = NULL; } } @@ -1137,6 +1138,9 @@ if (unit_classes[i].cache.native_tile_extras != NULL) {
[Freeciv-commits] r25272 - /branches/S2_5/ai/default/aiunit.c
Author: persia Date: Thu Jun 26 11:53:10 2014 New Revision: 25272 URL: http://svn.gna.org/viewcvs/freeciv?rev=25272view=rev Log: Fix home continent test to check continent rather than tile See bug #22237 Modified: branches/S2_5/ai/default/aiunit.c Modified: branches/S2_5/ai/default/aiunit.c URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_5/ai/default/aiunit.c?rev=25272r1=25271r2=25272view=diff == --- branches/S2_5/ai/default/aiunit.c (original) +++ branches/S2_5/ai/default/aiunit.c Thu Jun 26 11:53:10 2014 @@ -1949,7 +1949,7 @@ return FALSE; } /* if we're not at home continent */ -if (src != src_home_city) { +if (tile_continent(src) != tile_continent(src_home_city)) { return FALSE; } ___ Freeciv-commits mailing list Freeciv-commits@gna.org https://mail.gna.org/listinfo/freeciv-commits
[Freeciv-commits] r25273 - in /trunk: ./ ai/default/ client/ common/ data/alien/ data/civ1/ data/civ2/ data/civ2civ3/ data/classic/ data/exper...
Author: cazfi Date: Thu Jun 26 18:27:46 2014 New Revision: 25273 URL: http://svn.gna.org/viewcvs/freeciv?rev=25273view=rev Log: Removed IgWall unit type flag. Rulesets use present = FALSE requirements for Defend_Bonus effects to achieve what IgWall used to provide. See patch #4799 Modified: trunk/ai/default/advmilitary.c trunk/ai/default/advmilitary.h trunk/client/helpdata.c trunk/common/combat.c trunk/common/unittype.h trunk/data/alien/units.ruleset trunk/data/civ1/effects.ruleset trunk/data/civ1/units.ruleset trunk/data/civ2/effects.ruleset trunk/data/civ2/units.ruleset trunk/data/civ2civ3/units.ruleset trunk/data/classic/effects.ruleset trunk/data/classic/units.ruleset trunk/data/experimental/effects.ruleset trunk/data/experimental/units.ruleset trunk/data/multiplayer/effects.ruleset trunk/data/multiplayer/units.ruleset trunk/data/stub/units.ruleset trunk/doc/README.effects trunk/fc_version trunk/server/advisors/advdata.c trunk/server/advisors/advruleset.c [This mail would be too long, it was shortened to contain the URLs only.] Modified: trunk/ai/default/advmilitary.c URL: http://svn.gna.org/viewcvs/freeciv/trunk/ai/default/advmilitary.c?rev=25273r1=25272r2=25273view=diff Modified: trunk/ai/default/advmilitary.h URL: http://svn.gna.org/viewcvs/freeciv/trunk/ai/default/advmilitary.h?rev=25273r1=25272r2=25273view=diff Modified: trunk/client/helpdata.c URL: http://svn.gna.org/viewcvs/freeciv/trunk/client/helpdata.c?rev=25273r1=25272r2=25273view=diff Modified: trunk/common/combat.c URL: http://svn.gna.org/viewcvs/freeciv/trunk/common/combat.c?rev=25273r1=25272r2=25273view=diff Modified: trunk/common/unittype.h URL: http://svn.gna.org/viewcvs/freeciv/trunk/common/unittype.h?rev=25273r1=25272r2=25273view=diff Modified: trunk/data/alien/units.ruleset URL: http://svn.gna.org/viewcvs/freeciv/trunk/data/alien/units.ruleset?rev=25273r1=25272r2=25273view=diff Modified: trunk/data/civ1/effects.ruleset URL: http://svn.gna.org/viewcvs/freeciv/trunk/data/civ1/effects.ruleset?rev=25273r1=25272r2=25273view=diff Modified: trunk/data/civ1/units.ruleset URL: http://svn.gna.org/viewcvs/freeciv/trunk/data/civ1/units.ruleset?rev=25273r1=25272r2=25273view=diff Modified: trunk/data/civ2/effects.ruleset URL: http://svn.gna.org/viewcvs/freeciv/trunk/data/civ2/effects.ruleset?rev=25273r1=25272r2=25273view=diff Modified: trunk/data/civ2/units.ruleset URL: http://svn.gna.org/viewcvs/freeciv/trunk/data/civ2/units.ruleset?rev=25273r1=25272r2=25273view=diff Modified: trunk/data/civ2civ3/units.ruleset URL: http://svn.gna.org/viewcvs/freeciv/trunk/data/civ2civ3/units.ruleset?rev=25273r1=25272r2=25273view=diff Modified: trunk/data/classic/effects.ruleset URL: http://svn.gna.org/viewcvs/freeciv/trunk/data/classic/effects.ruleset?rev=25273r1=25272r2=25273view=diff Modified: trunk/data/classic/units.ruleset URL: http://svn.gna.org/viewcvs/freeciv/trunk/data/classic/units.ruleset?rev=25273r1=25272r2=25273view=diff Modified: trunk/data/experimental/effects.ruleset URL: http://svn.gna.org/viewcvs/freeciv/trunk/data/experimental/effects.ruleset?rev=25273r1=25272r2=25273view=diff Modified: trunk/data/experimental/units.ruleset URL: http://svn.gna.org/viewcvs/freeciv/trunk/data/experimental/units.ruleset?rev=25273r1=25272r2=25273view=diff Modified: trunk/data/multiplayer/effects.ruleset URL: http://svn.gna.org/viewcvs/freeciv/trunk/data/multiplayer/effects.ruleset?rev=25273r1=25272r2=25273view=diff Modified: trunk/data/multiplayer/units.ruleset URL: http://svn.gna.org/viewcvs/freeciv/trunk/data/multiplayer/units.ruleset?rev=25273r1=25272r2=25273view=diff Modified: trunk/data/stub/units.ruleset URL: http://svn.gna.org/viewcvs/freeciv/trunk/data/stub/units.ruleset?rev=25273r1=25272r2=25273view=diff Modified: trunk/doc/README.effects URL: http://svn.gna.org/viewcvs/freeciv/trunk/doc/README.effects?rev=25273r1=25272r2=25273view=diff Modified: trunk/fc_version URL: http://svn.gna.org/viewcvs/freeciv/trunk/fc_version?rev=25273r1=25272r2=25273view=diff Modified: trunk/server/advisors/advdata.c URL: http://svn.gna.org/viewcvs/freeciv/trunk/server/advisors/advdata.c?rev=25273r1=25272r2=25273view=diff Modified: trunk/server/advisors/advruleset.c URL: http://svn.gna.org/viewcvs/freeciv/trunk/server/advisors/advruleset.c?rev=25273r1=25272r2=25273view=diff ___ Freeciv-commits mailing list Freeciv-commits@gna.org https://mail.gna.org/listinfo/freeciv-commits
[Freeciv-commits] r25274 - in /trunk: ai/default/ server/
Author: cazfi Date: Thu Jun 26 19:39:07 2014 New Revision: 25274 URL: http://svn.gna.org/viewcvs/freeciv?rev=25274view=rev Log: Moved TECH_LOG functionality from server common code to default AI as only it uses it. See patch #4844 Modified: trunk/ai/default/advdomestic.c trunk/ai/default/advmilitary.c trunk/ai/default/aiair.c trunk/ai/default/aicity.c trunk/ai/default/aidiplomat.c trunk/ai/default/aiferry.c trunk/ai/default/aihand.c trunk/ai/default/aihunt.c trunk/ai/default/ailog.c trunk/ai/default/ailog.h trunk/ai/default/aiparatrooper.c trunk/ai/default/aisettler.c trunk/ai/default/aitech.c trunk/server/srv_log.c trunk/server/srv_log.h Modified: trunk/ai/default/advdomestic.c URL: http://svn.gna.org/viewcvs/freeciv/trunk/ai/default/advdomestic.c?rev=25274r1=25273r2=25274view=diff == --- trunk/ai/default/advdomestic.c (original) +++ trunk/ai/default/advdomestic.c Thu Jun 26 19:39:07 2014 @@ -55,6 +55,7 @@ #include advmilitary.h #include aicity.h #include aidata.h +#include ailog.h #include aiplayer.h #include aitech.h #include aitools.h Modified: trunk/ai/default/advmilitary.c URL: http://svn.gna.org/viewcvs/freeciv/trunk/ai/default/advmilitary.c?rev=25274r1=25273r2=25274view=diff == --- trunk/ai/default/advmilitary.c (original) +++ trunk/ai/default/advmilitary.c Thu Jun 26 19:39:07 2014 @@ -56,6 +56,7 @@ #include aiferry.h #include aihand.h #include aihunt.h +#include ailog.h #include aiparatrooper.h #include aiplayer.h #include aitech.h Modified: trunk/ai/default/aiair.c URL: http://svn.gna.org/viewcvs/freeciv/trunk/ai/default/aiair.c?rev=25274r1=25273r2=25274view=diff == --- trunk/ai/default/aiair.c(original) +++ trunk/ai/default/aiair.cThu Jun 26 19:39:07 2014 @@ -44,6 +44,7 @@ /* ai/default */ #include aicity.h #include aiplayer.h +#include ailog.h #include aitools.h #include aiunit.h Modified: trunk/ai/default/aicity.c URL: http://svn.gna.org/viewcvs/freeciv/trunk/ai/default/aicity.c?rev=25274r1=25273r2=25274view=diff == --- trunk/ai/default/aicity.c (original) +++ trunk/ai/default/aicity.c Thu Jun 26 19:39:07 2014 @@ -53,6 +53,7 @@ #include advdomestic.h #include advmilitary.h #include aihand.h +#include ailog.h #include aiplayer.h #include aisettler.h #include aitools.h Modified: trunk/ai/default/aidiplomat.c URL: http://svn.gna.org/viewcvs/freeciv/trunk/ai/default/aidiplomat.c?rev=25274r1=25273r2=25274view=diff == --- trunk/ai/default/aidiplomat.c (original) +++ trunk/ai/default/aidiplomat.c Thu Jun 26 19:39:07 2014 @@ -64,6 +64,7 @@ #include aidata.h #include aiguard.h #include aihand.h +#include ailog.h #include aiplayer.h #include aitools.h #include aiunit.h Modified: trunk/ai/default/aiferry.c URL: http://svn.gna.org/viewcvs/freeciv/trunk/ai/default/aiferry.c?rev=25274r1=25273r2=25274view=diff == --- trunk/ai/default/aiferry.c (original) +++ trunk/ai/default/aiferry.c Thu Jun 26 19:39:07 2014 @@ -48,6 +48,7 @@ /* ai/default */ #include aidata.h #include aiguard.h +#include ailog.h #include aiplayer.h #include aitools.h #include aiunit.h Modified: trunk/ai/default/aihand.c URL: http://svn.gna.org/viewcvs/freeciv/trunk/ai/default/aihand.c?rev=25274r1=25273r2=25274view=diff == --- trunk/ai/default/aihand.c (original) +++ trunk/ai/default/aihand.c Thu Jun 26 19:39:07 2014 @@ -57,6 +57,7 @@ #include advmilitary.h #include advspace.h #include aicity.h +#include ailog.h #include aiplayer.h #include aitech.h #include aitools.h Modified: trunk/ai/default/aihunt.c URL: http://svn.gna.org/viewcvs/freeciv/trunk/ai/default/aihunt.c?rev=25274r1=25273r2=25274view=diff == --- trunk/ai/default/aihunt.c (original) +++ trunk/ai/default/aihunt.c Thu Jun 26 19:39:07 2014 @@ -48,6 +48,7 @@ /* ai/default */ #include aicity.h +#include ailog.h #include aiplayer.h #include aitools.h #include aiunit.h Modified: trunk/ai/default/ailog.c URL: http://svn.gna.org/viewcvs/freeciv/trunk/ai/default/ailog.c?rev=25274r1=25273r2=25274view=diff == --- trunk/ai/default/ailog.c(original) +++ trunk/ai/default/ailog.cThu Jun 26 19:39:07 2014 @@ -55,6 +55,39 @@ fc_snprintf(buffer, buflength, %d %d, unit_data-bodyguard, unit_data-ferryboat); +} +
[Freeciv-commits] r25275 - in /trunk: Makefile.am m4/lcmessage.m4
Author: cazfi Date: Thu Jun 26 21:03:50 2014 New Revision: 25275 URL: http://svn.gna.org/viewcvs/freeciv?rev=25275view=rev Log: Removed obsolete lcmessage.m4 See patch #4843 Removed: trunk/m4/lcmessage.m4 Modified: trunk/Makefile.am Modified: trunk/Makefile.am URL: http://svn.gna.org/viewcvs/freeciv/trunk/Makefile.am?rev=25275r1=25274r2=25275view=diff == --- trunk/Makefile.am (original) +++ trunk/Makefile.am Thu Jun 26 21:03:50 2014 @@ -75,7 +75,6 @@ m4/gtk2-client.m4 \ m4/gtk3-client.m4 \ m4/iconv.m4 \ - m4/lcmessage.m4 \ m4/lib-ld.m4\ m4/lib-link.m4 \ m4/lib-prefix.m4\ Removed: trunk/m4/lcmessage.m4 URL: http://svn.gna.org/viewcvs/freeciv/trunk/m4/lcmessage.m4?rev=25274view=auto == --- trunk/m4/lcmessage.m4 (original) +++ trunk/m4/lcmessage.m4 (removed) @@ -1,23 +0,0 @@ -# Check whether LC_MESSAGES is available in locale.h. -# Ulrich Drepper drep...@cygnus.com, 1995. -# -# This file can be copied and used freely without restrictions. It can -# be used in projects which are not available under the GNU General Public -# License or the GNU Library General Public License but which still want -# to provide support for the GNU gettext functionality. -# Please note that the actual code of the GNU gettext library is covered -# by the GNU Library General Public License, and the rest of the GNU -# gettext package package is covered by the GNU General Public License. -# They are *not* in the public domain. - -# serial 2 - -AC_DEFUN([AM_LC_MESSAGES], - [if test $ac_cv_header_locale_h = yes; then -AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES, - [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include locale.h]], [[return LC_MESSAGES]])],[am_cv_val_LC_MESSAGES=yes],[am_cv_val_LC_MESSAGES=no])]) -if test $am_cv_val_LC_MESSAGES = yes; then - AC_DEFINE([HAVE_LC_MESSAGES], [1], -[Define if your locale.h file defines LC_MESSAGES.]) -fi - fi]) ___ Freeciv-commits mailing list Freeciv-commits@gna.org https://mail.gna.org/listinfo/freeciv-commits
[Freeciv-commits] r25255 - /branches/S2_5/translations/nations/fr.po
Author: igx31 Date: Tue Jun 24 07:46:15 2014 New Revision: 25255 URL: http://svn.gna.org/viewcvs/freeciv?rev=25255view=rev Log: - minor mispelling correction Modified: branches/S2_5/translations/nations/fr.po Modified: branches/S2_5/translations/nations/fr.po URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_5/translations/nations/fr.po?rev=25255r1=25254r2=25255view=diff == --- branches/S2_5/translations/nations/fr.po(original) +++ branches/S2_5/translations/nations/fr.poTue Jun 24 07:46:15 2014 @@ -15,8 +15,8 @@ msgstr Project-Id-Version: Freeciv 2.4\n Report-Msgid-Bugs-To: \n -POT-Creation-Date: 2013-10-21 01:55+0300\n -PO-Revision-Date: 2014-05-06 10:39+0200\n +POT-Creation-Date: 2014-06-22 23:15+0200\n +PO-Revision-Date: 2014-05-22 07:47+0200\n Last-Translator: Igx igx31 hotmail.com\n Language-Team: French freeciv-l10n...@yahoogroupes.fr\n Language: fr\n @@ -13173,7 +13173,7 @@ msgstr La République de Venise émergea des ombres de l'histoire quand des réfugiés de mauraudeurs barbares se regroupèrent en sécurité sur les îles du lagon du -Nord-Est de l'Italie. Initialement sujet loyal de l'Empire Romain d'Orien, +Nord-Est de l'Italie. Initialement sujet loyal de l'Empire Romain d'Orient, elle acquit graduellement son indépendance, et se classa parmi les superpuissances du moyen-âge. Ses marchands s'enrichirent dans le commerce et sa flotte était respectée dans toute la mer Méditerranée. Après un long ___ Freeciv-commits mailing list Freeciv-commits@gna.org https://mail.gna.org/listinfo/freeciv-commits
[Freeciv-commits] r25254 - /branches/S2_5/translations/freeciv/fr.po
Author: igx31 Date: Tue Jun 24 07:42:08 2014 New Revision: 25254 URL: http://svn.gna.org/viewcvs/freeciv?rev=25254view=rev Log: - Updates following source code evolution - Correction of a couple of translation errors - Correction of erroneous shortcuts - Mispelling corrections Modified: branches/S2_5/translations/freeciv/fr.po [This mail would be too long, it was shortened to contain the URLs only.] Modified: branches/S2_5/translations/freeciv/fr.po URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_5/translations/freeciv/fr.po?rev=25254r1=25253r2=25254view=diff ___ Freeciv-commits mailing list Freeciv-commits@gna.org https://mail.gna.org/listinfo/freeciv-commits
[Freeciv-commits] r25277 - /branches/S2_5/data/alien/game.ruleset
Author: cazfi Date: Thu Jun 26 21:26:29 2014 New Revision: 25277 URL: http://svn.gna.org/viewcvs/freeciv?rev=25277view=rev Log: Improved alien ruleset description about where additional information is available. See patch #4846 Modified: branches/S2_5/data/alien/game.ruleset Modified: branches/S2_5/data/alien/game.ruleset URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_5/data/alien/game.ruleset?rev=25277r1=25276r2=25277view=diff == --- branches/S2_5/data/alien/game.ruleset (original) +++ branches/S2_5/data/alien/game.ruleset Thu Jun 26 21:26:29 2014 @@ -12,7 +12,8 @@ description = _(One of the design goals of this ruleset is that it has to \ provide gameplay different from standard rules. Do not assume that any rules \ you know from classic rules apply with this ruleset.\n\n\ -See README.ruleset_alien and \ +See http://www.freeciv.org/wiki/Alien_World, \ +doc/README.ruleset_alien under freeciv version control and \ http://www.cazfi.net/freeciv/alien/ for ruleset info.) [options] ___ Freeciv-commits mailing list Freeciv-commits@gna.org https://mail.gna.org/listinfo/freeciv-commits
[Freeciv-commits] r25276 - /trunk/data/alien/game.ruleset
Author: cazfi Date: Thu Jun 26 21:26:23 2014 New Revision: 25276 URL: http://svn.gna.org/viewcvs/freeciv?rev=25276view=rev Log: Improved alien ruleset description about where additional information is available. See patch #4846 Modified: trunk/data/alien/game.ruleset Modified: trunk/data/alien/game.ruleset URL: http://svn.gna.org/viewcvs/freeciv/trunk/data/alien/game.ruleset?rev=25276r1=25275r2=25276view=diff == --- trunk/data/alien/game.ruleset (original) +++ trunk/data/alien/game.ruleset Thu Jun 26 21:26:23 2014 @@ -15,7 +15,8 @@ description = _(One of the design goals of this ruleset is that it has to \ provide gameplay different from standard rules. Do not assume that any rules \ you know from classic rules apply with this ruleset.\n\n\ -See README.ruleset_alien and \ +See http://www.freeciv.org/wiki/Alien_World, \ +doc/README.ruleset_alien under freeciv version control and \ http://www.cazfi.net/freeciv/alien/ for ruleset info.) [options] ___ Freeciv-commits mailing list Freeciv-commits@gna.org https://mail.gna.org/listinfo/freeciv-commits
[Freeciv-commits] r25278 - /trunk/configure.ac
Author: cazfi Date: Thu Jun 26 22:15:40 2014 New Revision: 25278 URL: http://svn.gna.org/viewcvs/freeciv?rev=25278view=rev Log: Added configure check for libxml2 See patch #4745 Modified: trunk/configure.ac Modified: trunk/configure.ac URL: http://svn.gna.org/viewcvs/freeciv/trunk/configure.ac?rev=25278r1=25277r2=25278view=diff == --- trunk/configure.ac (original) +++ trunk/configure.ac Thu Jun 26 22:15:40 2014 @@ -613,6 +613,22 @@ [AC_MSG_ERROR([libcurl development files required])]) UTILITY_CFLAGS=${UTILITY_CFLAGS} ${CURL_CFLAGS} UTILITY_LIBS=${UTILITY_LIBS} ${CURL_LIBS} + +AC_ARG_ENABLE([xml-registry], + AS_HELP_STRING([--enable-xml-registry], [build xml-backend for registry (WIP)]), +[case ${enableval} in + yes) XMLREGISTRY=yes ;; + no) XMLREGISTRY=no ;; + *) AC_MSG_ERROR([bad value ${enableval} for --enable-xml-registry]) ;; +esac], [XMLREGISTRY=no]) + +if test x$XMLREGISTRY = xyes ; then + PKG_CHECK_MODULES([LIBXML2], [libxml-2.0],, + [AC_MSG_ERROR([libxml2 development files required])]) + UTILITY_CFLAGS=${UTILITY_CFLAGS} ${LIBXML2_CFLAGS} + UTILITY_LIBS=${UTILITY_LIBS} ${LIBXML2_LIBS} + AC_DEFINE([HAVE_XML_REGISTRY], [1], [Build xml-backend for registry]) +fi dnl Set debug flags supported by compiler EXTRA_DEBUG_CFLAGS= ___ Freeciv-commits mailing list Freeciv-commits@gna.org https://mail.gna.org/listinfo/freeciv-commits
[Freeciv-commits] r25279 - in /trunk/common/aicore: path_finding.c path_finding.h
Author: pepeto Date: Thu Jun 26 22:35:49 2014 New Revision: 25279 URL: http://svn.gna.org/viewcvs/freeciv?rev=25279view=rev Log: Fix pf_map_XXX_iterate() macros since patch #4768 is applied. Also ass many assertions in pf_map_XXX() functions, preventing crashes. Report by Marko Lindqvist (cazfi@gna) and Andreas Rosdal (andreasr@gna) See gna bug #22230 Modified: trunk/common/aicore/path_finding.c trunk/common/aicore/path_finding.h Modified: trunk/common/aicore/path_finding.c URL: http://svn.gna.org/viewcvs/freeciv/trunk/common/aicore/path_finding.c?rev=25279r1=25278r2=25279view=diff == --- trunk/common/aicore/path_finding.c (original) +++ trunk/common/aicore/path_finding.c Thu Jun 26 22:35:49 2014 @@ -2852,6 +2852,9 @@ / void pf_map_destroy(struct pf_map *pfm) { +#ifdef PF_DEBUG + fc_assert_ret(NULL != pfm); +#endif pfm-destroy(pfm); } @@ -2862,6 +2865,10 @@ / int pf_map_move_cost(struct pf_map *pfm, struct tile *ptile) { +#ifdef PF_DEBUG + fc_assert_ret_val(NULL != pfm, PF_IMPOSSIBLE_MC); + fc_assert_ret_val(NULL != ptile, PF_IMPOSSIBLE_MC); +#endif return pfm-get_move_cost(pfm, ptile); } @@ -2874,6 +2881,10 @@ / struct pf_path *pf_map_path(struct pf_map *pfm, struct tile *ptile) { +#ifdef PF_DEBUG + fc_assert_ret_val(NULL != pfm, NULL); + fc_assert_ret_val(NULL != ptile, NULL); +#endif return pfm-get_path(pfm, ptile); } @@ -2885,6 +2896,10 @@ bool pf_map_position(struct pf_map *pfm, struct tile *ptile, struct pf_position *pos) { +#ifdef PF_DEBUG + fc_assert_ret_val(NULL != pfm, FALSE); + fc_assert_ret_val(NULL != ptile, FALSE); +#endif return pfm-get_position(pfm, ptile, pos); } @@ -2901,6 +2916,10 @@ / bool pf_map_iterate(struct pf_map *pfm) { +#ifdef PF_DEBUG + fc_assert_ret_val(NULL != pfm, FALSE); +#endif + if (NULL == pfm-tile) { /* The end of the iteration was already reached. Don't try to iterate * again. */ @@ -2927,6 +2946,9 @@ / struct tile *pf_map_iter(struct pf_map *pfm) { +#ifdef PF_DEBUG + fc_assert_ret_val(NULL != pfm, NULL); +#endif return pfm-tile; } @@ -2936,6 +2958,10 @@ / int pf_map_iter_move_cost(struct pf_map *pfm) { +#ifdef PF_DEBUG + fc_assert_ret_val(NULL != pfm, PF_IMPOSSIBLE_MC); + fc_assert_ret_val(NULL != pfm-tile, PF_IMPOSSIBLE_MC); +#endif return pfm-get_move_cost(pfm, pfm-tile); } @@ -2945,6 +2971,10 @@ / struct pf_path *pf_map_iter_path(struct pf_map *pfm) { +#ifdef PF_DEBUG + fc_assert_ret_val(NULL != pfm, NULL); + fc_assert_ret_val(NULL != pfm-tile, NULL); +#endif return pfm-get_path(pfm, pfm-tile); } @@ -2954,6 +2984,10 @@ / void pf_map_iter_position(struct pf_map *pfm, struct pf_position *pos) { +#ifdef PF_DEBUG + fc_assert_ret(NULL != pfm); + fc_assert_ret(NULL != pfm-tile); +#endif if (!pfm-get_position(pfm, pfm-tile, pos)) { /* Always fails. */ fc_assert(pfm-get_position(pfm, pfm-tile, pos)); @@ -2965,6 +2999,9 @@ / const struct pf_parameter *pf_map_parameter(const struct pf_map *pfm) { +#ifdef PF_DEBUG + fc_assert_ret_val(NULL != pfm, NULL); +#endif return pfm-params; } Modified: trunk/common/aicore/path_finding.h URL: http://svn.gna.org/viewcvs/freeciv/trunk/common/aicore/path_finding.h?rev=25279r1=25278r2=25279view=diff == --- trunk/common/aicore/path_finding.h (original) +++ trunk/common/aicore/path_finding.h Thu Jun 26 22:35:49 2014 @@ -488,7 +488,8 @@ * which indicate if the start tile should be iterated or * not. */ #define pf_map_tiles_iterate(ARG_pfm, NAME_tile, COND_from_start) \ -if ((COND_from_start) || pf_map_iterate((ARG_pfm))) { \ +if (NULL != pf_map_iter(ARG_pfm)\ + (COND_from_start || pf_map_iterate((ARG_pfm {\ struct pf_map *_MY_pf_map_ = (ARG_pfm); \ struct tile *NAME_tile; \ do { \ @@ -509,7 +510,8 @@ * not. */ #define
[Freeciv-commits] r25280 - /trunk/common/aicore/path_finding.c
Author: pepeto Date: Thu Jun 26 22:44:19 2014 New Revision: 25280 URL: http://svn.gna.org/viewcvs/freeciv?rev=25280view=rev Log: Use parameter-based hash table instead of unittype-based array for pf_reserve_map. See gna patch #4820 Modified: trunk/common/aicore/path_finding.c Modified: trunk/common/aicore/path_finding.c URL: http://svn.gna.org/viewcvs/freeciv/trunk/common/aicore/path_finding.c?rev=25280r1=25279r2=25280view=diff == --- trunk/common/aicore/path_finding.c (original) +++ trunk/common/aicore/path_finding.c Thu Jun 26 22:44:19 2014 @@ -3094,11 +3094,73 @@ * units needs to reach the start tile. It stores a pf_map for every unit * type. */ +static genhash_val_t pf_map_hash_val(const struct pf_parameter *parameter); +static bool pf_map_hash_cmp(const struct pf_parameter *parameter1, +const struct pf_parameter *parameter2); + +#define SPECHASH_TAG pf_map +#define SPECHASH_IKEY_TYPE struct pf_parameter * +#define SPECHASH_IDATA_TYPE struct pf_map * +#define SPECHASH_IKEY_VAL pf_map_hash_val +#define SPECHASH_IKEY_COMP pf_map_hash_cmp +#define SPECHASH_IDATA_FREE pf_map_destroy +#include spechash.h + /* The reverse map structure. */ struct pf_reverse_map { struct pf_parameter param;/* Keep a parameter ready for usage. */ - struct pf_map **maps; /* A vector of pf_map for every unit_type. */ + struct pf_map_hash *hash; /* A hash where pf_map are stored. */ }; + +/* Here goes all unit type flags which affect the move rules handled by + * the reverse map. */ +static const enum unit_type_flag_id signifiant_flags[] = { + UTYF_IGTER +}; +static const size_t signifiant_flags_num = ARRAY_SIZE(signifiant_flags); + +/ + Hash function for pf_parameter key. +/ +static genhash_val_t pf_map_hash_val(const struct pf_parameter *parameter) +{ + genhash_val_t result = 0; + size_t b, i; + + for (i = 0, b = sizeof(result) * 8 - 1; i signifiant_flags_num; + i++, b--) { +if (BV_ISSET(parameter-unit_flags, signifiant_flags[i])) { + result |= (1 b); +} + } + + return (result + + uclass_number(parameter-uclass) + + (parameter-move_rate 6)); +} + +/ + Comparison function for pf_parameter hash key. +/ +static bool pf_map_hash_cmp(const struct pf_parameter *parameter1, +const struct pf_parameter *parameter2) +{ + size_t i; + + if (parameter1-uclass != parameter2-uclass + || parameter1-move_rate != parameter2-move_rate) { +return FALSE; + } + + for (i = 0; i signifiant_flags_num; i++) { +if (BV_ISSET(parameter1-unit_flags, signifiant_flags[i]) +!= BV_ISSET(parameter2-unit_flags, signifiant_flags[i])) { + return FALSE; +} + } + + return TRUE; +} / This function estime the cost for unit moves to reach the start tile. @@ -3155,10 +3217,13 @@ param-start_tile = start_tile; param-owner = pplayer; param-omniscience = omniscient; + /* We don't deal with re-fuel points. */ + param-fuel = 1; + param-fuel_left_initially = 1; param-data = FC_INT_TO_PTR(max_turns); - /* Initialize the map vector. */ - pfrm-maps = fc_calloc(utype_count(), sizeof(*pfrm-maps)); + /* Initialize the map hash. */ + pfrm-hash = pf_map_hash_new(); return pfrm; } @@ -3179,17 +3244,9 @@ / void pf_reverse_map_destroy(struct pf_reverse_map *pfrm) { - struct pf_map **ppfm; - size_t i; - fc_assert_ret(NULL != pfrm); - for (i = 0, ppfm = pfrm-maps; i utype_count(); i++, ppfm++) { -if (NULL != *ppfm) { - pf_map_destroy(*ppfm); -} - } - free(pfrm-maps); + pf_map_hash_destroy(pfrm-hash); free(pfrm); } @@ -3200,32 +3257,28 @@ pf_reverse_map_utype_map(struct pf_reverse_map *pfrm, const struct unit_type *punittype) { - Unit_type_id index = utype_index(punittype); - struct pf_map *pfm = pfrm-maps[index]; - - if (NULL == pfm) { -struct pf_parameter *param = pfrm-param; -int max_turns = FC_PTR_TO_INT(param-data); - -/* Not created yet. */ -param-uclass = utype_class(punittype); -param-unit_flags = punittype-flags; -param-move_rate = punittype-move_rate; -param-moves_left_initially = punittype-move_rate; -if (utype_fuel(punittype)) { - param-fuel = utype_fuel(punittype); - param-fuel_left_initially = utype_fuel(punittype); -} else { - param-fuel = 1; - param-fuel_left_initially = 1; -} -pfm = pf_map_new(param); -
[Freeciv-commits] r25282 - /trunk/data/nation/formosan.ruleset
Author: jtn Date: Thu Jun 26 23:56:54 2014 New Revision: 25282 URL: http://svn.gna.org/viewcvs/freeciv?rev=25282view=rev Log: Add missing spaces to Formosan legend added in patch #4292. Modified: trunk/data/nation/formosan.ruleset Modified: trunk/data/nation/formosan.ruleset URL: http://svn.gna.org/viewcvs/freeciv/trunk/data/nation/formosan.ruleset?rev=25282r1=25281r2=25282view=diff == --- trunk/data/nation/formosan.ruleset (original) +++ trunk/data/nation/formosan.ruleset Thu Jun 26 23:56:54 2014 @@ -4,13 +4,13 @@ plural=_(?plural:Formosans) groups=Asian, Ancient, Medieval, Early Modern legend=_(Taiwan is home to fourteen officially recognized and twelve unrecognized tribes,\ -all of whom are traditionally speakers of a group of Austronesian languages\ -known as Formosan. Historical linguists consider the island to be the home\ -of the Austronesian family, as it is host to the most diverse set of Austronesian\ -languages. Many of the tribes are traditionally matrilineal. Starting in the 17th\ -century, European and East Asian colonists vied for control of the island,\ -encroaching on aboriginal lands. Today, Formosans constitute around 2%\ -of the population of Taiwan.) + all of whom are traditionally speakers of a group of Austronesian languages\ + known as Formosan. Historical linguists consider the island to be the home\ + of the Austronesian family, as it is host to the most diverse set of Austronesian\ + languages. Many of the tribes are traditionally matrilineal. Starting in the 17th\ + century, European and East Asian colonists vied for control of the island,\ + encroaching on aboriginal lands. Today, Formosans constitute around 2%\ + of the population of Taiwan.) leaders = { name,sex ___ Freeciv-commits mailing list Freeciv-commits@gna.org https://mail.gna.org/listinfo/freeciv-commits
[Freeciv-commits] r25281 - /trunk/data/nation/
Author: jtn Date: Thu Jun 26 23:56:51 2014 New Revision: 25281 URL: http://svn.gna.org/viewcvs/freeciv?rev=25281view=rev Log: Change Kievan Rus' rule_name back to Ruthenian for backward compatibility after r23250. (This will not be displayed in the UI.) See gna bug #22235. Modified: trunk/data/nation/gothic.ruleset trunk/data/nation/khazar.ruleset trunk/data/nation/lendian.ruleset trunk/data/nation/ruthenian.ruleset trunk/data/nation/sarmatian.ruleset trunk/data/nation/scythian.ruleset trunk/data/nation/slavic.ruleset trunk/data/nation/transnistrian.ruleset trunk/data/nation/ukrainian.ruleset trunk/data/nation/viking.ruleset trunk/data/nation/volgagerman.ruleset Modified: trunk/data/nation/gothic.ruleset URL: http://svn.gna.org/viewcvs/freeciv/trunk/data/nation/gothic.ruleset?rev=25281r1=25280r2=25281view=diff == --- trunk/data/nation/gothic.ruleset(original) +++ trunk/data/nation/gothic.rulesetThu Jun 26 23:56:51 2014 @@ -34,7 +34,7 @@ init_units= conflicts_with=Ostrogothic, Visigothic, Polish, Lendian, Ukrainian, - Cossack, Kievan Rus', Slovakian, Romanian, Moldovan, Russian, + Cossack, Ruthenian, Slovakian, Romanian, Moldovan, Russian, Mazovian, Crimean Tatar civilwar_nations=Ostrogothic, Visigothic Modified: trunk/data/nation/khazar.ruleset URL: http://svn.gna.org/viewcvs/freeciv/trunk/data/nation/khazar.ruleset?rev=25281r1=25280r2=25281view=diff == --- trunk/data/nation/khazar.ruleset(original) +++ trunk/data/nation/khazar.rulesetThu Jun 26 23:56:51 2014 @@ -44,7 +44,7 @@ init_buildings= init_units= -civilwar_nations=volga bulgar, israeli, kievan rus' +civilwar_nations=volga bulgar, israeli, ruthenian cities = Atil, Modified: trunk/data/nation/lendian.ruleset URL: http://svn.gna.org/viewcvs/freeciv/trunk/data/nation/lendian.ruleset?rev=25281r1=25280r2=25281view=diff == --- trunk/data/nation/lendian.ruleset (original) +++ trunk/data/nation/lendian.ruleset Thu Jun 26 23:56:51 2014 @@ -26,7 +26,7 @@ init_buildings= init_units= conflicts_with = ukrainian -civilwar_nations = polish, kievan rus', ukrainian +civilwar_nations = polish, ruthenian, ukrainian cities = CzerwieÅ, Modified: trunk/data/nation/ruthenian.ruleset URL: http://svn.gna.org/viewcvs/freeciv/trunk/data/nation/ruthenian.ruleset?rev=25281r1=25280r2=25281view=diff == --- trunk/data/nation/ruthenian.ruleset (original) +++ trunk/data/nation/ruthenian.ruleset Thu Jun 26 23:56:51 2014 @@ -2,6 +2,7 @@ name=_(Kievan Rus') plural=_(?plural:Kievan Rus') +rule_name=Ruthenian groups=European, Medieval legend=_(The Kievan Rus' were a Medieval Slavic monarchy. It was\ centered in Kiev after that city was conquered by Oleg of Novgorod.\ Modified: trunk/data/nation/sarmatian.ruleset URL: http://svn.gna.org/viewcvs/freeciv/trunk/data/nation/sarmatian.ruleset?rev=25281r1=25280r2=25281view=diff == --- trunk/data/nation/sarmatian.ruleset (original) +++ trunk/data/nation/sarmatian.ruleset Thu Jun 26 23:56:51 2014 @@ -32,8 +32,8 @@ init_techs= init_buildings= init_units= -conflicts_with = kazakh, khazar, soviet, kievan rus', russian, ukrainian, cossack, crimean tatar -civilwar_nations = scythian, ossetian, kievan rus', abkhaz, gothic, saka +conflicts_with = kazakh, khazar, soviet, ruthenian, russian, ukrainian, cossack, crimean tatar +civilwar_nations = scythian, ossetian, ruthenian, abkhaz, gothic, saka cities = Modified: trunk/data/nation/scythian.ruleset URL: http://svn.gna.org/viewcvs/freeciv/trunk/data/nation/scythian.ruleset?rev=25281r1=25280r2=25281view=diff == --- trunk/data/nation/scythian.ruleset (original) +++ trunk/data/nation/scythian.ruleset Thu Jun 26 23:56:51 2014 @@ -41,7 +41,7 @@ init_buildings= init_units= -conflicts_with=russian, ukrainian, kievan rus' +conflicts_with=russian, ukrainian, ruthenian civilwar_nations=thracian, persian, tocharian, ossetian, sarmatian, saka cities = Modified: trunk/data/nation/slavic.ruleset URL: http://svn.gna.org/viewcvs/freeciv/trunk/data/nation/slavic.ruleset?rev=25281r1=25280r2=25281view=diff == --- trunk/data/nation/slavic.ruleset(original) +++ trunk/data/nation/slavic.rulesetThu Jun 26 23:56:51 2014 @@ -41,14 +41,14 @@ init_buildings= init_units= -conflicts_with=Kievan Rus', Russian, Belarusian, Ukrainian, +conflicts_with=Ruthenian, Russian, Belarusian, Ukrainian, Cossack, Slovakian, Moravian, Czech, Lendian, Polish, Western
[Freeciv-commits] r25284 - /trunk/data/civ2civ3/buildings.ruleset
Author: jtn Date: Thu Jun 26 23:57:00 2014 New Revision: 25284 URL: http://svn.gna.org/viewcvs/freeciv?rev=25284view=rev Log: Fix obsolete_by syntax for a couple of civ2civ3 buildings. See gna bug #22238. Modified: trunk/data/civ2civ3/buildings.ruleset Modified: trunk/data/civ2civ3/buildings.ruleset URL: http://svn.gna.org/viewcvs/freeciv/trunk/data/civ2civ3/buildings.ruleset?rev=25284r1=25283r2=25284view=diff == --- trunk/data/civ2civ3/buildings.ruleset (original) +++ trunk/data/civ2civ3/buildings.ruleset Thu Jun 26 23:57:00 2014 @@ -1877,7 +1877,9 @@ } graphic= b.womens_suffrage graphic_alt= - -obsolete_by= None +obsolete_by= +{ type, name, range +} build_cost = 600 upkeep = 0 sabotage = 0 @@ -1902,7 +1904,9 @@ } graphic= b.capitalization graphic_alt= - -obsolete_by= None +obsolete_by= +{ type, name, range +} build_cost = 999 upkeep = 0 sabotage = 0 ___ Freeciv-commits mailing list Freeciv-commits@gna.org https://mail.gna.org/listinfo/freeciv-commits
[Freeciv-commits] r25283 - /trunk/data/nation/lycian.ruleset
Author: jtn Date: Thu Jun 26 23:56:57 2014 New Revision: 25283 URL: http://svn.gna.org/viewcvs/freeciv?rev=25283view=rev Log: Comment out not-yet-added Lydian civilwar nation from Lycian ruleset added in gna patch #3318. Modified: trunk/data/nation/lycian.ruleset Modified: trunk/data/nation/lycian.ruleset URL: http://svn.gna.org/viewcvs/freeciv/trunk/data/nation/lycian.ruleset?rev=25283r1=25282r2=25283view=diff == --- trunk/data/nation/lycian.ruleset(original) +++ trunk/data/nation/lycian.rulesetThu Jun 26 23:56:57 2014 @@ -30,7 +30,7 @@ init_units= conflicts_with=Turkish, Ottoman, Byzantine -civilwar_nations = Lydian, Luwian, Hittite, Greek ;carian +civilwar_nations = Luwian, Hittite, Greek ;Lydian, carian cities = Pttara, ;Patara ___ Freeciv-commits mailing list Freeciv-commits@gna.org https://mail.gna.org/listinfo/freeciv-commits
[Freeciv-commits] r25285 - in /trunk: data/civ2civ3/buildings.ruleset data/civ2civ3/effects.ruleset doc/README.ruleset_civ2civ3
Author: cazfi Date: Fri Jun 27 00:31:37 2014 New Revision: 25285 URL: http://svn.gna.org/viewcvs/freeciv?rev=25285view=rev Log: civ2civ3: Granary reduces food waste by 50%. Patch by David Fernandez bardo See bug #22191 Modified: trunk/data/civ2civ3/buildings.ruleset trunk/data/civ2civ3/effects.ruleset trunk/doc/README.ruleset_civ2civ3 Modified: trunk/data/civ2civ3/buildings.ruleset URL: http://svn.gna.org/viewcvs/freeciv/trunk/data/civ2civ3/buildings.ruleset?rev=25285r1=25284r2=25285view=diff == --- trunk/data/civ2civ3/buildings.ruleset (original) +++ trunk/data/civ2civ3/buildings.ruleset Fri Jun 27 00:31:37 2014 @@ -425,10 +425,10 @@ Whenever a city with a Granary shrinks or grows, the foodbox keeps\ 10 stored food. This helps a city to grow faster and more easily\ withstand famine.\ -) -; NOTE: -; In Civ2, city size reduction does not generate food like this. -; Dare I ask where this food comes from?? :-) +), _(\ +Granary also halves the waste of food caused by distance to Palace. \ + Together with a Courthouse, it eliminates completely the waste of food.\ +) [building_harbour] name= _(Harbor) Modified: trunk/data/civ2civ3/effects.ruleset URL: http://svn.gna.org/viewcvs/freeciv/trunk/data/civ2civ3/effects.ruleset?rev=25285r1=25284r2=25285view=diff == --- trunk/data/civ2civ3/effects.ruleset (original) +++ trunk/data/civ2civ3/effects.ruleset Fri Jun 27 00:31:37 2014 @@ -1941,7 +1941,6 @@ OutputType, Shield, local } -; Total -1% food each 4 tiles [effect_courthouse_2] type= Output_Waste_Pct value = 25 @@ -1982,6 +1981,15 @@ reqs= { type, name, range Building, Factory, City +} + +[effect_granary] +type= Output_Waste_Pct +value = 25 +reqs= +{ type, name, range + Building, Granary, City + OutputType, Food, local } ; Free Granary effect Modified: trunk/doc/README.ruleset_civ2civ3 URL: http://svn.gna.org/viewcvs/freeciv/trunk/doc/README.ruleset_civ2civ3?rev=25285r1=25284r2=25285view=diff == --- trunk/doc/README.ruleset_civ2civ3 (original) +++ trunk/doc/README.ruleset_civ2civ3 Fri Jun 27 00:31:37 2014 @@ -1,6 +1,6 @@ == -Civ2Civ3 Ruleset for Freeciv v2.6 (Updated 16-Jun-2014) +Civ2Civ3 Ruleset for Freeciv v2.6 (Updated 27-Jun-2014) == @@ -244,6 +244,7 @@ - Courthouse: Make_Content = 1, and reduces to half any kind of waste (Trade, Shields or Food). Added new effect: Food wasted by distance to Palace = -1% Food each 2 tiles. For example, cities at distance 20 of the Palace lose -10% Food (-5% with courthouse), so they lose -1 Food when their production reaches 10 Food per turn (20 Food per turn with courthouse), noticeable when city reaches size 5 or so (around city size 10 with courthouse). +- Granary halves the waste of food caused by distance to Palace. Together with a Courthouse, it eliminates completely the waste of food. - Police Station: Make_Content = 2, and reduces unhappiness caused by 1 Military unit. - Science bonus by buildings (Library, University and Research Lab) restored to civ2 values (+50%). There are wonders that double the effect later. - Production bonus by Factory and Mfg Plant reduced to +25% each (was +50%), so the Power Plants are as important as the Factories. Mfg Plants allows the construction of 2 items per turn. @@ -442,6 +443,7 @@ - Disabled happyborders: Units cause military unhappiness if they end the turn outside cities or fortresses, no matter if they are inside national borders. - Readjusted effect of some wonders: Mausoleum of Mausolos, Statue of Liberty, and those related to military unhappiness. Marco Polo's Embassy obsolete by Democracy. - Fixed Aqueducts (same as Barracks) to avoid duplicated bonuses when there are two of them in the same ciy. +- Granary halves the waste of food caused by distance to Palace. - Swapped Empire Size values for Fundamentalism (now 20) and Monarchy (now 12). - Pollution may appear in ocean tiles. Transports can clean it without the need of Workers\Engineers. - Enabled random disasters, and readjusted effects. Plague renamed to Flood. ___ Freeciv-commits mailing list Freeciv-commits@gna.org https://mail.gna.org/listinfo/freeciv-commits
[Freeciv-commits] r25286 - in /branches/S2_5: data/civ2civ3/buildings.ruleset data/civ2civ3/effects.ruleset doc/README.ruleset_civ2civ3
Author: cazfi Date: Fri Jun 27 00:32:08 2014 New Revision: 25286 URL: http://svn.gna.org/viewcvs/freeciv?rev=25286view=rev Log: civ2civ3: Granary reduces food waste by 50%. Patch by David Fernandez bardo See bug #22191 Modified: branches/S2_5/data/civ2civ3/buildings.ruleset branches/S2_5/data/civ2civ3/effects.ruleset branches/S2_5/doc/README.ruleset_civ2civ3 Modified: branches/S2_5/data/civ2civ3/buildings.ruleset URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_5/data/civ2civ3/buildings.ruleset?rev=25286r1=25285r2=25286view=diff == --- branches/S2_5/data/civ2civ3/buildings.ruleset (original) +++ branches/S2_5/data/civ2civ3/buildings.ruleset Fri Jun 27 00:32:08 2014 @@ -394,10 +394,10 @@ Whenever a city with a Granary shrinks or grows, the foodbox keeps\ 10 stored food. This helps a city to grow faster and more easily\ withstand famine.\ -) -; NOTE: -; In Civ2, city size reduction does not generate food like this. -; Dare I ask where this food comes from?? :-) +), _(\ +Granary also halves the waste of food caused by distance to Palace. \ + Together with a Courthouse, it eliminates completely the waste of food.\ +) [building_harbour] name= _(Harbor) Modified: branches/S2_5/data/civ2civ3/effects.ruleset URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_5/data/civ2civ3/effects.ruleset?rev=25286r1=25285r2=25286view=diff == --- branches/S2_5/data/civ2civ3/effects.ruleset (original) +++ branches/S2_5/data/civ2civ3/effects.ruleset Fri Jun 27 00:32:08 2014 @@ -2086,7 +2086,6 @@ OutputType, Shield, local } -; Total -1% food each 4 tiles [effect_courthouse_2] type= Output_Waste_Pct value = 25 @@ -2127,6 +2126,15 @@ reqs= { type, name, range Building, Factory, City +} + +[effect_granary] +type= Output_Waste_Pct +value = 25 +reqs= +{ type, name, range + Building, Granary, City + OutputType, Food, local } ; Free Granary effect Modified: branches/S2_5/doc/README.ruleset_civ2civ3 URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_5/doc/README.ruleset_civ2civ3?rev=25286r1=25285r2=25286view=diff == --- branches/S2_5/doc/README.ruleset_civ2civ3 (original) +++ branches/S2_5/doc/README.ruleset_civ2civ3 Fri Jun 27 00:32:08 2014 @@ -1,6 +1,6 @@ == -Civ2Civ3 Ruleset for Freeciv v2.5 (Updated 16-Jun-2014) +Civ2Civ3 Ruleset for Freeciv v2.5 (Updated 27-Jun-2014) == @@ -244,6 +244,7 @@ - Courthouse: Make_Content = 1, and reduces to half any kind of waste (Trade, Shields or Food). Added new effect: Food wasted by distance to Palace = -1% Food each 2 tiles. For example, cities at distance 20 of the Palace lose -10% Food (-5% with courthouse), so they lose -1 Food when their production reaches 10 Food per turn (20 Food per turn with courthouse), noticeable when city reaches size 5 or so (around city size 10 with courthouse). +- Granary halves the waste of food caused by distance to Palace. Together with a Courthouse, it eliminates completely the waste of food. - Police Station: Make_Content = 2, and reduces unhappiness caused by 1 Military unit. - Science bonus by buildings (Library, University and Research Lab) restored to civ2 values (+50%). There are wonders that double the effect later. - Production bonus by Factory and Mfg Plant reduced to +25% each (was +50%), so the Power Plants are as important as the Factories. Mfg Plants allows the construction of 2 items per turn. @@ -442,6 +443,7 @@ - Disabled happyborders: Units cause military unhappiness if they end the turn outside cities or fortresses, no matter if they are inside national borders. - Readjusted effect of some wonders: Mausoleum of Mausolos, Statue of Liberty, and those related to military unhappiness. Marco Polo's Embassy obsolete by Democracy. - Fixed Aqueducts (same as Barracks) to avoid duplicated bonuses when there are two of them in the same ciy. +- Granary halves the waste of food caused by distance to Palace. - Swapped Empire Size values for Fundamentalism (now 20) and Monarchy (now 12). - Pollution may appear in ocean tiles. Transports can clean it without the need of Workers\Engineers. - Enabled random disasters, and readjusted effects. Plague renamed to Flood. ___ Freeciv-commits mailing list Freeciv-commits@gna.org https://mail.gna.org/listinfo/freeciv-commits
[Freeciv-commits] r25288 - in /trunk: ./ ai/threaded/ client/ common/ server/ server/advisors/
Author: cazfi Date: Fri Jun 27 01:00:26 2014 New Revision: 25288 URL: http://svn.gna.org/viewcvs/freeciv?rev=25288view=rev Log: Added worker task packets to network protocol, and their handling. No gui support producing worker task requests yet. See patch #4851 Modified: trunk/ai/threaded/taicity.c trunk/client/packhand.c trunk/common/city.c trunk/common/city.h trunk/common/packets.def trunk/fc_version trunk/server/advisors/autosettlers.c trunk/server/unithand.c Modified: trunk/ai/threaded/taicity.c URL: http://svn.gna.org/viewcvs/freeciv/trunk/ai/threaded/taicity.c?rev=25288r1=25287r2=25288view=diff == --- trunk/ai/threaded/taicity.c (original) +++ trunk/ai/threaded/taicity.c Fri Jun 27 01:00:26 2014 @@ -196,8 +196,8 @@ log_debug(%s storing req for act %d at (%d,%d), pcity-name, data-task.act, TILE_XY(data-task.ptile)); -pcity-server.task_req.ptile = data-task.ptile; -pcity-server.task_req.act = data-task.act; -pcity-server.task_req.tgt = data-task.tgt; +pcity-task_req.ptile = data-task.ptile; +pcity-task_req.act = data-task.act; +pcity-task_req.tgt = data-task.tgt; } } Modified: trunk/client/packhand.c URL: http://svn.gna.org/viewcvs/freeciv/trunk/client/packhand.c?rev=25288r1=25287r2=25288view=diff == --- trunk/client/packhand.c (original) +++ trunk/client/packhand.c Fri Jun 27 01:00:26 2014 @@ -1063,6 +1063,25 @@ if (update_descriptions) { update_city_description(pcity); } +} + +/** + Handle worker task assigned to the city +**/ +void handle_worker_task(const struct packet_worker_task *packet) +{ + struct city *pcity = game_city_by_number(packet-city_id); + + if (pcity == NULL || pcity-owner != client.conn.playing) { +return; + } + + /* It's ok for the tile to be NULL. That means clearing + * existing worker task. */ + pcity-task_req.ptile = index_to_tile(packet-tile_id); + pcity-task_req.act = packet-activity; + pcity-task_req.tgt = extra_by_number(packet-tgt); + pcity-task_req.want = packet-want; } /** Modified: trunk/common/city.c URL: http://svn.gna.org/viewcvs/freeciv/trunk/common/city.c?rev=25288r1=25287r2=25288view=diff == --- trunk/common/city.c (original) +++ trunk/common/city.c Fri Jun 27 01:00:26 2014 @@ -3078,10 +3078,10 @@ pcity-units_supported = unit_list_new(); + worker_task_init(pcity-task_req); + if (is_server()) { pcity-server.mgr_score_calc_turn = -1; /* -1 = never */ - -worker_task_init(pcity-server.task_req); CALL_FUNC_EACH_AI(city_alloc, pcity); CALL_PLR_AI_FUNC(city_got, pplayer, pplayer, pcity); Modified: trunk/common/city.h URL: http://svn.gna.org/viewcvs/freeciv/trunk/common/city.h?rev=25288r1=25287r2=25288view=diff == --- trunk/common/city.h (original) +++ trunk/common/city.h Fri Jun 27 01:00:26 2014 @@ -384,6 +384,8 @@ int history; /* Cumulative culture */ + struct worker_task task_req; + union { struct { /* Only used in the server (./ai/ and ./server/). */ @@ -415,8 +417,6 @@ void *ais[FC_AI_LAST]; struct vision *vision; - - struct worker_task task_req; } server; struct { Modified: trunk/common/packets.def URL: http://svn.gna.org/viewcvs/freeciv/trunk/common/packets.def?rev=25288r1=25287r2=25288view=diff == --- trunk/common/packets.def(original) +++ trunk/common/packets.defFri Jun 27 01:00:26 2014 @@ -3,7 +3,7 @@ Max used id: -Max id: 240 +Max id: 241 Packets are not ordered by their id, but by their category. New packet with higher id may get added to existing category, and not to the end of file. @@ -720,6 +720,14 @@ BV_IMPRS improvements; end +PACKET_WORKER_TASK = 241; cs, sc, lsend, handle-via-packet + CITY city_id; + TILE tile_id; + ACTIVITY activity; + EXTRA tgt; + UINT16 want; +end + /** Player packets **/ PACKET_PLAYER_REMOVE = 50; sc, dsend, cancel(PACKET_PLAYER_INFO) Modified: trunk/fc_version URL: http://svn.gna.org/viewcvs/freeciv/trunk/fc_version?rev=25288r1=25287r2=25288view=diff == --- trunk/fc_version(original) +++ trunk/fc_versionFri Jun 27 01:00:26 2014 @@ -52,7 +52,7 @@ # - Avoid adding a new mandatory capability to the development branch for # as long as