[Freeciv-Dev] Re: (PR#15097) air units only autoroute to my cities (or a
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
<URL: http://bugs.freeciv.org/Ticket/Display.html?id=15097 >
Jason Short wrote:
> Your patch is slightly broken...attached is a patch that I think does
> what you're trying to do: allows a goto into a seemingly unsafe tile so
> long as a unit has enough moves to return.
Forgot the patch.
Index: data/default/units.ruleset
===================================================================
--- data/default/units.ruleset (revision 11575)
+++ data/default/units.ruleset (working copy)
@@ -964,7 +964,7 @@
[unit_fighter]
name = _("Fighter")
class = "Air"
-tech_req = "Flight"
+tech_req = "None"
obsolete_by = "Stealth Fighter"
graphic = "u.fighter"
graphic_alt = "-"
@@ -972,7 +972,7 @@
sound_move_alt = "m_generic"
sound_fight = "f_fighter"
sound_fight_alt = "f_generic"
-build_cost = 60
+build_cost = 1
pop_cost = 0
attack = 4
defense = 3
@@ -992,7 +992,7 @@
[unit_bomber]
name = _("Bomber")
class = "Air"
-tech_req = "Advanced Flight"
+tech_req = "None"
obsolete_by = "Stealth Bomber"
graphic = "u.bomber"
graphic_alt = "-"
@@ -1000,13 +1000,13 @@
sound_move_alt = "m_generic"
sound_fight = "f_bomber"
sound_fight_alt = "f_generic"
-build_cost = 120
+build_cost = 1
pop_cost = 0
attack = 12
defense = 1
hitpoints = 20
firepower = 2
-move_rate = 8
+move_rate = 4
vision_radius_sq = 8
transport_cap = 0
fuel = 2
Index: common/aicore/pf_tools.c
===================================================================
--- common/aicore/pf_tools.c (revision 11575)
+++ common/aicore/pf_tools.c (working copy)
@@ -535,7 +535,8 @@
enum known_type known,
struct pf_parameter *param)
{
- /* FIXME: bombers with fuel remaining should not worry about danger. */
+ const int moves = SINGLE_MOVE * real_map_distance(param->start_tile, ptile);
+ const int fuel = param->fuel_left_initially - 1;
if (is_allied_city_tile(ptile, param->owner)) {
return FALSE;
@@ -547,6 +548,10 @@
return FALSE;
}
+ if (param->moves_left_initially + param->move_rate * fuel >= moves * 2) {
+ return FALSE;
+ }
+
/* Carriers are ignored since they are likely to move. */
return TRUE;
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Freeciv-Dev] Re: (PR#15097) air units only autoroute to my cities (or allies),
Jason Short <=
|
|