Author: sveinung Date: Sun Mar 26 16:36:35 2017 New Revision: 35162 URL: http://svn.gna.org/viewcvs/freeciv?rev=35162&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: branches/S3_0/client/control.c branches/S3_0/client/gui-gtk-3.0/action_dialog.c branches/S3_0/client/gui-gtk-3.22/action_dialog.c branches/S3_0/client/gui-qt/dialogs.cpp branches/S3_0/client/packhand.c branches/S3_0/common/networking/packets.def branches/S3_0/fc_version branches/S3_0/server/unithand.c Modified: branches/S3_0/client/control.c URL: http://svn.gna.org/viewcvs/freeciv/branches/S3_0/client/control.c?rev=35162&r1=35161&r2=35162&view=diff ============================================================================== --- branches/S3_0/client/control.c (original) +++ branches/S3_0/client/control.c Sun Mar 26 16:36:35 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: branches/S3_0/client/gui-gtk-3.0/action_dialog.c URL: http://svn.gna.org/viewcvs/freeciv/branches/S3_0/client/gui-gtk-3.0/action_dialog.c?rev=35162&r1=35161&r2=35162&view=diff ============================================================================== --- branches/S3_0/client/gui-gtk-3.0/action_dialog.c (original) +++ branches/S3_0/client/gui-gtk-3.0/action_dialog.c Sun Mar 26 16:36:35 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: branches/S3_0/client/gui-gtk-3.22/action_dialog.c URL: http://svn.gna.org/viewcvs/freeciv/branches/S3_0/client/gui-gtk-3.22/action_dialog.c?rev=35162&r1=35161&r2=35162&view=diff ============================================================================== --- branches/S3_0/client/gui-gtk-3.22/action_dialog.c (original) +++ branches/S3_0/client/gui-gtk-3.22/action_dialog.c Sun Mar 26 16:36:35 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: branches/S3_0/client/gui-qt/dialogs.cpp URL: http://svn.gna.org/viewcvs/freeciv/branches/S3_0/client/gui-qt/dialogs.cpp?rev=35162&r1=35161&r2=35162&view=diff ============================================================================== --- branches/S3_0/client/gui-qt/dialogs.cpp (original) +++ branches/S3_0/client/gui-qt/dialogs.cpp Sun Mar 26 16:36:35 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: branches/S3_0/client/packhand.c URL: http://svn.gna.org/viewcvs/freeciv/branches/S3_0/client/packhand.c?rev=35162&r1=35161&r2=35162&view=diff ============================================================================== --- branches/S3_0/client/packhand.c (original) +++ branches/S3_0/client/packhand.c Sun Mar 26 16:36:35 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); } @@ -2577,7 +2576,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: branches/S3_0/common/networking/packets.def URL: http://svn.gna.org/viewcvs/freeciv/branches/S3_0/common/networking/packets.def?rev=35162&r1=35161&r2=35162&view=diff ============================================================================== --- branches/S3_0/common/networking/packets.def (original) +++ branches/S3_0/common/networking/packets.def Sun Mar 26 16:36:35 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: branches/S3_0/fc_version URL: http://svn.gna.org/viewcvs/freeciv/branches/S3_0/fc_version?rev=35162&r1=35161&r2=35162&view=diff ============================================================================== --- branches/S3_0/fc_version (original) +++ branches/S3_0/fc_version Sun Mar 26 16:36:35 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.0-2016.Nov.13" +NETWORK_CAPSTRING_MANDATORY="+Freeciv.Devel-3.0-2017.Mar.26" NETWORK_CAPSTRING_OPTIONAL="" FREECIV_DISTRIBUTOR="" Modified: branches/S3_0/server/unithand.c URL: http://svn.gna.org/viewcvs/freeciv/branches/S3_0/server/unithand.c?rev=35162&r1=35161&r2=35162&view=diff ============================================================================== --- branches/S3_0/server/unithand.c (original) +++ branches/S3_0/server/unithand.c Sun Mar 26 16:36:35 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