Author: mir3x
Date: Fri Nov 20 17:19:19 2015
New Revision: 30715

URL: http://svn.gna.org/viewcvs/freeciv?rev=30715&view=rev
Log:
Fixed failed assertions at endgame in qt-client. 

See bug #24093


Modified:
    trunk/client/gui-qt/mapview.cpp

Modified: trunk/client/gui-qt/mapview.cpp
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-qt/mapview.cpp?rev=30715&r1=30714&r2=30715&view=diff
==============================================================================
--- trunk/client/gui-qt/mapview.cpp     (original)
+++ trunk/client/gui-qt/mapview.cpp     Fri Nov 20 17:19:19 2015
@@ -1583,21 +1583,26 @@
 void unit_label::uupdate(unit_list *punits)
 {
   struct city *pcity;
-  struct unit *punit = unit_list_get(punits, 0);
+  struct unit *punit;
   struct player *owner;
   struct canvas *unit_pixmap;
   struct canvas *tile_pixmap;
   no_units = false;
   one_unit = true;
   setFixedHeight(56);
-  if (unit_list_size(punits) == 0 || punits == nullptr
-      || C_S_OVER == client_state()) {
+
+  if (punits == nullptr) {
+    return;
+  }
+  if (unit_list_size(punits) == 0 || C_S_OVER == client_state()) {
     unit_label1 = "";
     unit_label2 = "";
     no_units = true;
     update();
     return;
-  } else if (unit_list_size(punits) == 1) {
+  }
+  punit = unit_list_get(punits, 0);
+  if (unit_list_size(punits) == 1) {
     if (unit_list_size(unit_tile(punit)->units) > 1) {
       one_unit = false;
     }


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

Reply via email to