Author: pepeto Date: Sun Sep 14 11:21:35 2014 New Revision: 26398 URL: http://svn.gna.org/viewcvs/freeciv?rev=26398&view=rev Log: Fix that nuclears are able to nuke their current tile.
Reported by Jacob Nevins <jtn> See gna bug #22610 Modified: branches/S2_5/client/control.c Modified: branches/S2_5/client/control.c URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_5/client/control.c?rev=26398&r1=26397&r2=26398&view=diff ============================================================================== --- branches/S2_5/client/control.c (original) +++ branches/S2_5/client/control.c Sun Sep 14 11:21:35 2014 @@ -2624,6 +2624,7 @@ if (is_valid_goto_draw_line(ptile)) { struct client_nuke_data *data = fc_malloc(sizeof(*data)); + int last_request_id_used = client.conn.client.last_request_id_used; int i = 0; data->units_id = fc_malloc(sizeof(*data->units_id) @@ -2635,9 +2636,19 @@ data->tile_idx = tile_index(ptile); send_goto_route(); - update_queue_connect_processing_finished_full - (client.conn.client.last_request_id_used, - do_real_unit_nuke, data, client_nuke_data_destroy); + + if (last_request_id_used != client.conn.client.last_request_id_used) { + /* We sent some packets, let's wait the server to process them to know + * where our units hold. */ + update_queue_connect_processing_finished_full + (client.conn.client.last_request_id_used, + do_real_unit_nuke, data, client_nuke_data_destroy); + } else { + /* We didn't sent the packets, that mean that the route was nil, or + * an internal error occured. Process nuke units now. */ + do_real_unit_nuke(data); + client_nuke_data_destroy(data); + } } else { create_event(ptile, E_BAD_COMMAND, ftc_client, _("Didn't find a route to the destination!")); _______________________________________________ Freeciv-commits mailing list Freeciv-commits@gna.org https://mail.gna.org/listinfo/freeciv-commits