[Freeciv-commits] r34119 - /branches/S2_6/ai/default/daidiplomacy.c

2016-10-13 Thread cazfi74
Author: cazfi
Date: Fri Oct 14 06:53:26 2016
New Revision: 34119

URL: http://svn.gna.org/viewcvs/freeciv?rev=34119=rev
Log:
Randomize AI love on first contact.

Reported by Jacob Nevins 

See bug #25045

Modified:
branches/S2_6/ai/default/daidiplomacy.c

Modified: branches/S2_6/ai/default/daidiplomacy.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/ai/default/daidiplomacy.c?rev=34119=34118=34119=diff
==
--- branches/S2_6/ai/default/daidiplomacy.c (original)
+++ branches/S2_6/ai/default/daidiplomacy.c Fri Oct 14 06:53:26 2016
@@ -922,6 +922,9 @@
  struct player *aplayer)
 {
   bool wants_ceasefire = FALSE;
+
+  /* Randomize initial love */
+  pplayer->ai_common.love[player_index(aplayer)] += 2 - fc_rand(5);
 
   if (pplayer->ai_controlled
   && player_diplstate_get(pplayer, aplayer)->type == DS_WAR


___
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits


[Freeciv-commits] r34118 - /trunk/ai/default/daidiplomacy.c

2016-10-13 Thread cazfi74
Author: cazfi
Date: Fri Oct 14 06:53:19 2016
New Revision: 34118

URL: http://svn.gna.org/viewcvs/freeciv?rev=34118=rev
Log:
Randomize AI love on first contact.

Reported by Jacob Nevins 

See bug #25045

Modified:
trunk/ai/default/daidiplomacy.c

Modified: trunk/ai/default/daidiplomacy.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/ai/default/daidiplomacy.c?rev=34118=34117=34118=diff
==
--- trunk/ai/default/daidiplomacy.c (original)
+++ trunk/ai/default/daidiplomacy.c Fri Oct 14 06:53:19 2016
@@ -923,6 +923,9 @@
  struct player *aplayer)
 {
   bool wants_ceasefire = FALSE;
+
+  /* Randomize initial love */
+  pplayer->ai_common.love[player_index(aplayer)] += 2 - fc_rand(5);
 
   if (is_ai(pplayer)
   && player_diplstate_get(pplayer, aplayer)->type == DS_WAR


___
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits


[Freeciv-commits] r34116 - in /trunk: configure.ac m4/gtk3.22-client.m4

2016-10-13 Thread cazfi74
Author: cazfi
Date: Thu Oct 13 18:06:37 2016
New Revision: 34116

URL: http://svn.gna.org/viewcvs/freeciv?rev=34116=rev
Log:
Changed gtk3.22-client enabling --enable-client value to 'gtk3.22'

See patch #7806

Modified:
trunk/configure.ac
trunk/m4/gtk3.22-client.m4

Modified: trunk/configure.ac
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/configure.ac?rev=34116=34115=34116=diff
==
--- trunk/configure.ac  (original)
+++ trunk/configure.ac  Thu Oct 13 18:06:37 2016
@@ -417,7 +417,7 @@
 
 gui_gtk2=no
 gui_gtk3=no
-gui_gtk3x=no
+gui_gtk3_22=no
 gui_sdl2=no
 gui_qt=no
 gui_stub=no
@@ -440,8 +440,8 @@
  test "x$gui" = "xgtk30"  ||
  test "x$gui" = "xgtk-3.0" ; then
   gui_gtk3=yes
-elif test "x$gui" = "xgtk3x" ; then
-  gui_gtk3x=yes
+elif test "x$gui" = "xgtk3.22" ; then
+  gui_gtk3_22=yes
 elif test "x$gui" = "xgtk" ; then
   AC_MSG_WARN([for requested client 'gtk' enabled gtk3-client, that has 
changed since earlier versions and will change again in the future])
   gui_gtk3=yes
@@ -999,7 +999,7 @@
 if test "x$client" = "xall" ; then
   if test "x$gui_gtk2" = "xyes" ||
  test "x$gui_gtk3" = "xyes" ||
- test "x$gui_gtk3x" = "xyes" ||
+ test "x$gui_gtk3_22" = "xyes" ||
  test "x$gui_sdl2" = "xyes" ||
  test "x$gui_qt" = "xyes" ||
  test "x$gui_stub" = "xyes" ; then
@@ -1030,14 +1030,14 @@
 
 dnl freeciv-modpack checks
 AC_ARG_ENABLE([fcmp],
-  AS_HELP_STRING([--enable-fcmp=no/yes/gtk2/gtk3/gtk3x/qt/cli/all/auto], 
[build freeciv-modpack-program [auto]]),
+  AS_HELP_STRING([--enable-fcmp=no/yes/gtk2/gtk3/gtk3.22/qt/cli/all/auto], 
[build freeciv-modpack-program [auto]]),
 [fc_mp=${enableval}],
 [fc_mp=auto])
 
 fcmp_cli=no
 fcmp_gtk2=no
 fcmp_gtk3=no
-fcmp_gtk3x=no
+fcmp_gtk3_22=no
 fcmp_qt=no
 fcmp_list=
 
@@ -1063,8 +1063,8 @@
  test "x$mp" = "xgtk30"  ||
  test "x$mp" = "xgtk-3.0" ; then
   req_fcmp_gtk3=yes
-elif test "x$mp" = "xgtk3x" ; then
-  req_fcmp_gtk3x=yes
+elif test "x$mp" = "xgtk3.22" ; then
+  req_fcmp_gtk3_22=yes
 elif test "x$mp" = "xqt" ; then
   req_fcmp_qt=yes
 elif test "x$mp" = "xcli" ; then
@@ -1103,7 +1103,7 @@
   AC_MSG_ERROR([Cannot build gtk3-version of freeciv-modpack as requested])
 fi
 
-if test "x$req_fcmp_gtk3x" = "xyes" ||
+if test "x$req_fcmp_gtk3_22" = "xyes" ||
test "x$modinst" = "xall" || test "x$modinst" = "xauto" ; then
   PKG_CHECK_MODULES([GTK3X_MP], [gtk+-3.0 >= 3.18.0],
 [
@@ -,8 +,8 @@
   GTK3X_MP_CFLAGS="$GTK3X_MP_CFLAGS 
-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_46"
   PKG_CHECK_MODULES([GTHREAD_GTK3X], [gthread-2.0],
 [
-  fcmp_gtk3x=yes
-  fcmp_list="$fcmp_list gtk3x"
+  fcmp_gtk3_22=yes
+  fcmp_list="$fcmp_list gtk3.22"
   mp_gtk3x_cflags="$GTK3X_MP_CFLAGS $GHTREAD_GTK3X_CFLAGS"
   mp_gtk3x_libs="$GTK3X_MP_LIBS $GTHREAD_GTK3X_LIBS"
   if test "x$MINGW32" = "xyes"; then
@@ -1127,8 +1127,8 @@
 ], [])], [])
 fi
 
-if test "x$req_fcmp_gtk3x" = "xyes" && test "x$fcmp_gtk3x" != "xyes" ; then
-  AC_MSG_ERROR([Cannot build gtk3x-version of freeciv-modpack as requested])
+if test "x$req_fcmp_gtk3_22" = "xyes" && test "x$fcmp_gtk3_22" != "xyes" ; then
+  AC_MSG_ERROR([Cannot build gtk3.22-version of freeciv-modpack as requested])
 fi
 
 if test "x$req_fcmp_gtk2" = "xyes" ||
@@ -1193,7 +1193,7 @@
test "x$modinst" != "xno" &&
test "x$modinst" != "xcli" &&
test "x$fcmp_gtk3" != "xyes" &&
-   test "x$fcmp_gtk3x" != "xyes" &&
+   test "x$fcmp_gtk3_22" != "xyes" &&
test "x$fcmp_gtk2" != "xyes" &&
test "x$fcmp_qt" != "xyes" ;then
   AC_MSG_ERROR([Cannot build modpack installer with any gui])
@@ -1212,7 +1212,7 @@
 
 AM_CONDITIONAL([MODINST], [test "x$modinst" != "xno"])
 AM_CONDITIONAL([MODINST_GTK3], [test "x$fcmp_gtk3" = "xyes"])
-AM_CONDITIONAL([MODINST_GTK3X], [test "x$fcmp_gtk3x" = "xyes"])
+AM_CONDITIONAL([MODINST_GTK3X], [test "x$fcmp_gtk3_22" = "xyes"])
 AM_CONDITIONAL([MODINST_GTK2], [test "x$fcmp_gtk2" = "xyes"])
 AM_CONDITIONAL([MODINST_QT], [test "x$fcmp_qt" = "xyes"])
 AM_CONDITIONAL([MODINST_CLI], [test "x$fcmp_cli" = "xyes"])
@@ -1300,7 +1300,7 @@
 AM_CONDITIONAL(CLIENT_GUI_SDL2, test "x$gui_sdl2" = "xyes")
 AM_CONDITIONAL(CLIENT_GUI_GTK_2_0, test "x$gui_gtk2" = "xyes")
 AM_CONDITIONAL(CLIENT_GUI_GTK_3_0, test "x$gui_gtk3" = "xyes")
-AM_CONDITIONAL(CLIENT_GUI_GTK_3_22, test "x$gui_gtk3x" = "xyes")
+AM_CONDITIONAL(CLIENT_GUI_GTK_3_22, test "x$gui_gtk3_22" = "xyes")
 AM_CONDITIONAL(CLIENT_GUI_GTK_3X, /bin/false)
 AM_CONDITIONAL(CLIENT_GUI_QT, test "x$gui_qt" = "xyes")
 AM_CONDITIONAL(CLIENT_GUI_STUB, test "x$gui_stub" = "xyes")
@@ -1848,7 +1848,7 @@
 
   In-development client frontends:
   (these are not yet ready for general use)
-Gtk-3.x  $gui_gtk3x
+Gtk-3.22 $gui_gtk3_22
 
   Not maintained client frontends:
 Gtk-2.0: $gui_gtk2

Modified: trunk/m4/gtk3.22-client.m4
URL: 

[Freeciv-commits] r34115 - /trunk/server/unithand.c

2016-10-13 Thread sveinung84
Author: sveinung
Date: Thu Oct 13 12:12:39 2016
New Revision: 34115

URL: http://svn.gna.org/viewcvs/freeciv?rev=34115=rev
Log:
Explanation: "Conquer City" is city targeted.

Check the target city's tile rather than a potentially missing target tile
when trying to explain why the "Conquer City" action was illegal.

Reported by Andreas Røsdal 

See bug #25170

Modified:
trunk/server/unithand.c

Modified: trunk/server/unithand.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/server/unithand.c?rev=34115=34114=34115=diff
==
--- trunk/server/unithand.c (original)
+++ trunk/server/unithand.c Thu Oct 13 12:12:39 2016
@@ -865,9 +865,14 @@
 action_custom = unit_attack_units_at_tile_result(punit, target_tile);
 break;
   case ACTION_CONQUER_CITY:
-action_custom = unit_move_to_tile_test(punit, punit->activity,
-   unit_tile(punit), target_tile,
-   FALSE, NULL, TRUE);
+if (target_city) {
+  action_custom = unit_move_to_tile_test(punit, punit->activity,
+ unit_tile(punit),
+ city_tile(target_city),
+ FALSE, NULL, TRUE);
+} else {
+  action_custom = MR_OK;
+}
 break;
   default:
 action_custom = 0;


___
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits


[Freeciv-commits] r34112 - /trunk/tools/civmanual.c

2016-10-13 Thread sveinung84
Author: sveinung
Date: Thu Oct 13 12:10:56 2016
New Revision: 34112

URL: http://svn.gna.org/viewcvs/freeciv?rev=34112=rev
Log:
freeciv-manual: split the item separator.

Replace SEPARATOR with ITEM_BEGIN and ITEM_END. Use the div tag to separate
the items in the HTML output.

See patch #7817

Modified:
trunk/tools/civmanual.c

Modified: trunk/tools/civmanual.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/tools/civmanual.c?rev=34112=34111=34112=diff
==
--- trunk/tools/civmanual.c (original)
+++ trunk/tools/civmanual.c Thu Oct 13 12:10:56 2016
@@ -94,7 +94,8 @@
 #define SECTION_END ""
 #define IMAGE_BEGIN ""
-#define SEPARATOR " "
+#define ITEM_BEGIN "\n"
+#define ITEM_END "\n"
 #define TAIL ""
 #else  /* MANUAL_USE_HTML */
 #define FILE_EXT "mediawiki"
@@ -105,7 +106,8 @@
 #define SECTION_END "==="
 #define IMAGE_BEGIN "[[Image:"
 #define IMAGE_END ".png]]"
-#define SEPARATOR "\n\n"
+#define ITEM_BEGIN "\n\n"
+#define ITEM_END "\n"
 #define TAIL " "
 #endif /* MANUAL_USE_HTML */
 
@@ -244,7 +246,7 @@
 char buf[256];
 const char *sethelp;
 
-fprintf(doc, SEPARATOR);
+fprintf(doc, ITEM_BEGIN);
 fprintf(doc, "%s%s - %s%s\n\n", SECTION_BEGIN, setting_name(pset),
 _(setting_short_help(pset)), SECTION_END);
 sethelp = _(setting_extra_help(pset, TRUE));
@@ -316,6 +318,8 @@
   fprintf(doc, _("Value set to %s\n\n"),
   setting_value_name(pset, TRUE, buf, sizeof(buf)));
 }
+
+fprintf(doc, ITEM_END);
   } settings_iterate_end;
   break;
 
@@ -325,7 +329,7 @@
   for (i = 0; i < CMD_NUM; i++) {
 const struct command *cmd = command_by_number(i);
 
-fprintf(doc, SEPARATOR);
+fprintf(doc, ITEM_BEGIN);
 fprintf(doc, "%s%s  -  %s%s\n\n", SECTION_BEGIN, command_name(cmd),
 command_short_help(cmd), SECTION_END);
 if (command_synopsis(cmd)) {
@@ -352,6 +356,8 @@
 FC_FREE(help);
   }
 }
+
+fprintf(doc, ITEM_END);
   }
   break;
 
@@ -546,6 +552,8 @@
   TITLE_BEGIN, VERSION_STRING, TITLE_END);
   unit_type_iterate(putype) {
 char buf[64000];
+
+fprintf(doc, ITEM_BEGIN);
 fprintf(doc, "%s%s%s\n\n", SECTION_BEGIN,
 utype_name_translation(putype), SECTION_END);
 fprintf(doc,
@@ -569,7 +577,7 @@
 putype->hp);
 helptext_unit(buf, sizeof(buf), NULL, "", putype);
 fprintf(doc, "%s", buf);
-fprintf(doc, SEPARATOR);
+fprintf(doc, ITEM_END);
   } unit_type_iterate_end;
   break;
 


___
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits