Author: cazfi Date: Mon Dec 14 02:08:51 2015 New Revision: 30977 URL: http://svn.gna.org/viewcvs/freeciv?rev=30977&view=rev Log: Do not handle page message part in the client side if it was decided upon receipt of the header packet that this page message will be ignored. This happens for example for observers.
See bug #24168 Modified: branches/S2_5/client/packhand.c Modified: branches/S2_5/client/packhand.c URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_5/client/packhand.c?rev=30977&r1=30976&r2=30977&view=diff ============================================================================== --- branches/S2_5/client/packhand.c (original) +++ branches/S2_5/client/packhand.c Mon Dec 14 02:08:51 2015 @@ -1323,19 +1323,23 @@ ****************************************************************************/ void handle_page_msg_part(const char *lines) { - fc_strlcat(page_msg_report.lines, lines, page_msg_report.len + 1); - page_msg_report.parts--; - - if (page_msg_report.parts == 0) { - /* This is the final part */ - popup_notify_dialog(page_msg_report.caption, - page_msg_report.headline, - page_msg_report.lines); - play_sound_for_event(page_msg_report.event); - - free(page_msg_report.caption); - free(page_msg_report.headline); - free(page_msg_report.lines); + if (page_msg_report.lines != NULL) { + /* We have already decided to show the message at the time we got + * the header packet. */ + fc_strlcat(page_msg_report.lines, lines, page_msg_report.len + 1); + page_msg_report.parts--; + + if (page_msg_report.parts == 0) { + /* This is the final part */ + popup_notify_dialog(page_msg_report.caption, + page_msg_report.headline, + page_msg_report.lines); + play_sound_for_event(page_msg_report.event); + + free(page_msg_report.caption); + free(page_msg_report.headline); + free(page_msg_report.lines); + } } } _______________________________________________ Freeciv-commits mailing list Freeciv-commits@gna.org https://mail.gna.org/listinfo/freeciv-commits