<URL: http://bugs.freeciv.org/Ticket/Display.html?id=37296 >
can_unit_survive_at_tile() still considers MOVE_HELI to be same as
hp_loss_pct and MOVE_AIR to mean fuel usage. Fix attached. Uses
is_losing_hp() from #37262.
- ML
diff -Nurd -X.diff_ignore freeciv/common/movement.c freeciv/common/movement.c
--- freeciv/common/movement.c 2007-02-12 15:27:43.000000000 +0200
+++ freeciv/common/movement.c 2007-03-01 23:25:21.000000000 +0200
@@ -272,17 +272,16 @@
return TRUE;
}
- switch (get_unit_move_type(unit_type(punit))) {
- case LAND_MOVING:
- case SEA_MOVING:
- return TRUE;
- case AIR_MOVING:
- return tile_has_base_flag(punit->tile, BF_REFUEL);
- case HELI_MOVING:
- return tile_has_base_flag(punit->tile, BF_NO_HP_LOSS);
- default:
- die("Invalid move type");
+ if (unit_type(punit)->fuel > 0
+ && !tile_has_base_flag(punit->tile, BF_REFUEL)) {
+ return FALSE;
}
+
+ if (is_losing_hp(punit)
+ && !tile_has_base_flag(punit->tile, BF_NO_HP_LOSS)) {
+ return FALSE;
+ }
+
return TRUE;
}
_______________________________________________
Freeciv-dev mailing list
[email protected]
https://mail.gna.org/listinfo/freeciv-dev