[Freeciv-Dev] Re: (PR#2345) Portattacks 7.1
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Raahul Kumar via RT wrote:
> The new updated portattacks, based on Per's portattacks 4. The AI is now
> almost
> ready to use subs.
>
> Same as the previous portattack patches. Subs can now attack ships in cities,
> although they still can't attack land units. Coastal defence stops sub attacks
> on cities.
I still have the question, that was asked before (by someone else) but I
didn't see an answer: what happens if a sub attacks a city with a weak
ship defender and a strong land defender?
For the patch itself...
- if (!enemy) {
+ if (!enemy && enemy == NULL)/* no valid target */ {
This is a duplicate check. I think the !enemy check is preferred
(although I have no preference).
+ unit_list_iterate(map_get_tile(pcity->x, pcity->y)->units, defender) {
+ if (unit_flag(punit, F_NO_LAND_ATTACK) &&
(!is_sailing_unit(defender))) {
+ continue;
+ }
+ }unit_list_iterate_end;
What is this supposed to do? It looks like it does nothing.
jason
|
|