Author: sveinung
Date: Sun Mar 26 16:33:14 2017
New Revision: 35160

URL: http://svn.gna.org/viewcvs/freeciv?rev=35160&view=rev
Log:
packet_unit_get_actions: don't specify tgt city.

Drop the unit_get_actions packet's ability to specify city id. There is
never more than one city at a tile. Take the city from the tile.

See hrm Feature #647692

Modified:
    trunk/client/control.c
    trunk/client/gui-gtk-3.0/action_dialog.c
    trunk/client/gui-gtk-3.22/action_dialog.c
    trunk/client/gui-qt/dialogs.cpp
    trunk/client/packhand.c
    trunk/common/networking/packets.def
    trunk/fc_version
    trunk/server/unithand.c

Modified: trunk/client/control.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/control.c?rev=35160&r1=35159&r2=35160&view=diff
==============================================================================
--- trunk/client/control.c      (original)
+++ trunk/client/control.c      Sun Mar 26 16:33:14 2017
@@ -354,7 +354,6 @@
 
   dsend_packet_unit_get_actions(&client.conn,
                                 punit->id,
-                                IDENTITY_NUMBER_ZERO,
                                 IDENTITY_NUMBER_ZERO,
                                 tile_index(punit->action_decision_tile),
                                 TRUE);

Modified: trunk/client/gui-gtk-3.0/action_dialog.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-gtk-3.0/action_dialog.c?rev=35160&r1=35159&r2=35160&view=diff
==============================================================================
--- trunk/client/gui-gtk-3.0/action_dialog.c    (original)
+++ trunk/client/gui-gtk-3.0/action_dialog.c    Sun Mar 26 16:33:14 2017
@@ -1248,18 +1248,12 @@
                                       /* Let the server choose the target
                                        * unit. */
                                       IDENTITY_NUMBER_ZERO,
-                                      /* Let the server choose the target
-                                       * city. */
-                                      IDENTITY_NUMBER_ZERO,
                                       tgt_tile->index,
                                       TRUE);
       } else {
         dsend_packet_unit_get_actions(&client.conn,
                                       actor->id,
                                       tgt_id,
-                                      /* Let the server choose the target
-                                       * city. */
-                                      IDENTITY_NUMBER_ZERO,
                                       tgt_tile->index,
                                       TRUE);
       }

Modified: trunk/client/gui-gtk-3.22/action_dialog.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-gtk-3.22/action_dialog.c?rev=35160&r1=35159&r2=35160&view=diff
==============================================================================
--- trunk/client/gui-gtk-3.22/action_dialog.c   (original)
+++ trunk/client/gui-gtk-3.22/action_dialog.c   Sun Mar 26 16:33:14 2017
@@ -1242,18 +1242,12 @@
                                       /* Let the server choose the target
                                        * unit. */
                                       IDENTITY_NUMBER_ZERO,
-                                      /* Let the server choose the target
-                                       * city. */
-                                      IDENTITY_NUMBER_ZERO,
                                       tgt_tile->index,
                                       TRUE);
       } else {
         dsend_packet_unit_get_actions(&client.conn,
                                       actor->id,
                                       tgt_id,
-                                      /* Let the server choose the target
-                                       * city. */
-                                      IDENTITY_NUMBER_ZERO,
                                       tgt_tile->index,
                                       TRUE);
       }

Modified: trunk/client/gui-qt/dialogs.cpp
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-qt/dialogs.cpp?rev=35160&r1=35159&r2=35160&view=diff
==============================================================================
--- trunk/client/gui-qt/dialogs.cpp     (original)
+++ trunk/client/gui-qt/dialogs.cpp     Sun Mar 26 16:33:14 2017
@@ -1423,7 +1423,6 @@
   dsend_packet_unit_get_actions(&client.conn,
                                 unit_id,
                                 targeted_unit->id,
-                                IDENTITY_NUMBER_ZERO,
                                 targeted_unit->tile->index,
                                 TRUE);
   layout->addLayout(unit_skip);

Modified: trunk/client/packhand.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/packhand.c?rev=35160&r1=35159&r2=35160&view=diff
==============================================================================
--- trunk/client/packhand.c     (original)
+++ trunk/client/packhand.c     Sun Mar 26 16:33:14 2017
@@ -879,7 +879,6 @@
     dsend_packet_unit_get_actions(&client.conn,
                                   action_selection_actor_unit(),
                                   action_selection_target_unit(),
-                                  action_selection_target_city(),
                                   city_tile(pcity)->index,
                                   FALSE);
   }
@@ -2578,7 +2577,6 @@
       dsend_packet_unit_get_actions(&client.conn,
                                     action_selection_actor_unit(),
                                     action_selection_target_unit(),
-                                    action_selection_target_city(),
                                     tgt_tile->index,
                                     FALSE);
     }

Modified: trunk/common/networking/packets.def
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/common/networking/packets.def?rev=35160&r1=35159&r2=35160&view=diff
==============================================================================
--- trunk/common/networking/packets.def (original)
+++ trunk/common/networking/packets.def Sun Mar 26 16:33:14 2017
@@ -1071,7 +1071,6 @@
 PACKET_UNIT_GET_ACTIONS = 87; cs, handle-per-conn, dsend
   UNIT actor_unit_id;
   UNIT target_unit_id;
-  CITY target_city_id;
   TILE target_tile_id;
 
   BOOL disturb_player;

Modified: trunk/fc_version
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/fc_version?rev=35160&r1=35159&r2=35160&view=diff
==============================================================================
--- trunk/fc_version    (original)
+++ trunk/fc_version    Sun Mar 26 16:33:14 2017
@@ -56,7 +56,7 @@
 #   - Avoid adding a new mandatory capability to the development branch for
 #     as long as possible.  We want to maintain network compatibility with
 #     the stable branch for as long as possible.
-NETWORK_CAPSTRING_MANDATORY="+Freeciv.Devel-3.1-2017.Jan.02"
+NETWORK_CAPSTRING_MANDATORY="+Freeciv.Devel-3.1-2017.Mar.26"
 NETWORK_CAPSTRING_OPTIONAL=""
 
 FREECIV_DISTRIBUTOR=""

Modified: trunk/server/unithand.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/server/unithand.c?rev=35160&r1=35159&r2=35160&view=diff
==============================================================================
--- trunk/server/unithand.c     (original)
+++ trunk/server/unithand.c     Sun Mar 26 16:33:14 2017
@@ -1431,7 +1431,6 @@
 void handle_unit_get_actions(struct connection *pc,
                              const int actor_unit_id,
                              const int target_unit_id_client,
-                             const int target_city_id_client,
                              const int target_tile_id,
                              const bool disturb_player)
 {
@@ -1483,18 +1482,11 @@
     target_unit = game_unit_by_number(target_unit_id_client);
   }
 
-  if (target_city_id_client == IDENTITY_NUMBER_ZERO) {
-    /* Find a new target city. */
-    target_city = action_tgt_city(actor_unit, target_tile, TRUE);
-  } else {
-    /* Prepare the client selected target city. */
-    target_city = game_city_by_number(target_city_id_client);
-  }
-
-  /* The specified target unit or target city must be located at the target
-   * tile. */
-  if ((target_city && city_tile(target_city) != target_tile)
-      || (target_unit && unit_tile(target_unit) != target_tile)) {
+  /* Find the target city. */
+  target_city = action_tgt_city(actor_unit, target_tile, TRUE);
+
+  /* The specified target unit must be located at the target tile. */
+  if (target_unit && unit_tile(target_unit) != target_tile) {
     notify_player(actor_player, unit_tile(actor_unit),
                   E_BAD_COMMAND, ftc_server,
                   _("Target not at target tile."));


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

Reply via email to