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

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

See bug #24093


Modified:
    branches/S2_5/client/gui-qt/mapview.cpp

Modified: branches/S2_5/client/gui-qt/mapview.cpp
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_5/client/gui-qt/mapview.cpp?rev=30714&r1=30713&r2=30714&view=diff
==============================================================================
--- branches/S2_5/client/gui-qt/mapview.cpp     (original)
+++ branches/S2_5/client/gui-qt/mapview.cpp     Fri Nov 20 17:19:05 2015
@@ -1579,21 +1579,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