Author: mir3x
Date: Sun Nov 20 23:13:43 2016
New Revision: 34587

URL: http://svn.gna.org/viewcvs/freeciv?rev=34587&view=rev
Log:
Don't use move_type in Qt client
Submitted by Emmet Hikory <persia>

See patch #4868


Modified:
    branches/S2_6/client/gui-qt/citydlg.cpp
    branches/S2_6/client/gui-qt/menu.cpp

Modified: branches/S2_6/client/gui-qt/citydlg.cpp
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-qt/citydlg.cpp?rev=34587&r1=34586&r2=34587&view=diff
==============================================================================
--- branches/S2_6/client/gui-qt/citydlg.cpp     (original)
+++ branches/S2_6/client/gui-qt/citydlg.cpp     Sun Nov 20 23:13:43 2016
@@ -3556,6 +3556,7 @@
   color col;
   QIcon icon = qapp->style()->standardIcon(QStyle::SP_DialogCancelButton);
   bool free_sprite = false;
+  struct unit_class *pclass;
 
   if (!option.rect.isValid()) {
     return;
@@ -3579,12 +3580,22 @@
   } else if (VUT_UTYPE == target->kind) {
     name = utype_name_translation(target->value.utype);
     is_neutral = utype_has_flag(target->value.utype, UTYF_CIVILIAN);
-
-    if (utype_move_type(target->value.utype) == UMT_SEA) {
+    pclass = utype_class(target->value.utype);
+    if (!uclass_has_flag(pclass, UCF_TERRAIN_DEFENSE)
+        && !uclass_has_flag(pclass, UCF_CAN_FORTIFY)
+        && !uclass_has_flag(pclass, UCF_ZOC)) {
       is_sea = true;
     }
 
-    if (utype_move_type(target->value.utype) == UMT_BOTH) {
+    if ((utype_fuel(target->value.utype)
+         && !uclass_has_flag(pclass, UCF_TERRAIN_DEFENSE)
+        && !uclass_has_flag(pclass, UCF_CAN_PILLAGE)
+        && !uclass_has_flag(pclass, UCF_CAN_FORTIFY)
+        && !uclass_has_flag(pclass, UCF_ZOC))
+        || uclass_has_flag(pclass, UCF_MISSILE)) {
+      if (is_sea == true) {
+        is_sea = false;
+      }
       is_flying = true;
     }
 

Modified: branches/S2_6/client/gui-qt/menu.cpp
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-qt/menu.cpp?rev=34587&r1=34586&r2=34587&view=diff
==============================================================================
--- branches/S2_6/client/gui-qt/menu.cpp        (original)
+++ branches/S2_6/client/gui-qt/menu.cpp        Sun Nov 20 23:13:43 2016
@@ -1505,8 +1505,7 @@
     utype_id = utype_index(utype);
 
     if (!can_player_build_unit_now(client.conn.playing, utype)
-        || utype_move_type(utype) != UMT_LAND
-        || utype_has_flag(utype, UTYF_NOBUILD)) {
+        || !uclass_has_flag(utype_class(utype), UCF_AIRLIFTABLE)) {
       continue;
     }
     if (!can_player_build_unit_now(client.conn.playing, utype)


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

Reply via email to