<URL: http://bugs.freeciv.org/Ticket/Display.html?id=37634 >

 This fixes some problems with air units *without* fuel and non-air
units *with* fuel.


 - ML

diff -Nurd -X.diff_ignore freeciv/common/unit.c freeciv/common/unit.c
--- freeciv/common/unit.c	2007-03-06 03:34:32.000000000 +0200
+++ freeciv/common/unit.c	2007-03-06 07:26:56.000000000 +0200
@@ -992,7 +992,7 @@
   switch(punit->activity) {
    case ACTIVITY_IDLE:
      moves_str = _("Moves");
-     if (is_air_unit(punit) && unit_type(punit)->fuel > 0) {
+     if (unit_type(punit)->fuel) {
        int rate,f;
        rate=unit_type(punit)->move_rate/SINGLE_MOVE;
        f=((punit->fuel)-1);
diff -Nurd -X.diff_ignore freeciv/server/unittools.c freeciv/server/unittools.c
--- freeciv/server/unittools.c	2007-03-06 03:34:32.000000000 +0200
+++ freeciv/server/unittools.c	2007-03-06 07:22:12.000000000 +0200
@@ -348,7 +348,7 @@
     }
 
     /* 4) Rescue planes if needed */
-    if (is_air_unit(punit)) {
+    if (unit_type(punit)->fuel) {
       /* Shall we emergency return home on the last vapors? */
 
       /* I think this is strongly against the spirit of client goto.
@@ -441,8 +441,7 @@
 
   /* 7) Check if there are air units without fuel */
   unit_list_iterate_safe(pplayer->units, punit) {
-    if (is_air_unit(punit) && punit->fuel <= 0
-        && unit_type(punit)->fuel > 0) {
+    if (punit->fuel <= 0 && unit_type(punit)->fuel) {
       notify_player(pplayer, punit->tile, E_UNIT_LOST, 
 		       _("Your %s has run out of fuel."),
 		       unit_name(punit->type));
_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to