Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2003:
[Freeciv-Dev] Re: (PR#4620) Re: (PR#4260) assertion in get_defender
Home

[Freeciv-Dev] Re: (PR#4620) Re: (PR#4260) assertion in get_defender

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: kaufman@xxxxxxxxxxxxxxxxxxxxxx, ChrisK@xxxxxxxx, kenn@xxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#4620) Re: (PR#4260) assertion in get_defender
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 15 Aug 2003 09:42:54 -0700
Reply-to: rt@xxxxxxxxxxxxxx

Per I. Mathisen wrote:
> On Fri, 15 Aug 2003, Jason Short wrote:
> 
>>>>The battleship is attacking a transport.The transport's tile
>>>>contains a second unit - the Mech. Inf. from an allied player that
>>>>is being transported_by the transport.
>>>
>>>Oh, and...
>>>
>>>The battleship's owner (player 0) is in DS_ALLIANCE withthe
>>>transport's owner (player 4), but has DS_NO_CONTACT with the Mech
>>>Inf's owner (player 18).
>>
>>So, obviously the immediate problem is that the transport cannot be
>>attacked (it's allied). The Mech Inf can be attacked, but cannot defend
>>here(we're on ocean). Thus count==1 but bestdef==NULL.  The code to
>>catch this error may or may not be overzealous.
> 
> 
> common/combat.c
> 586     count++;
> 587     if (unit_can_defend_here(defender)) {
> 
> Swap the two lines above. End of problem.

True, although:

- This goes against Greg's idea that alliances should be ignored.

- This makes the sanity check below useless; it should be removed.

jason




[Prev in Thread] Current Thread [Next in Thread]