Complete.Org: Mailing Lists: Archives: freeciv-dev: March 1999:
[Freeciv-Dev] Problem with Helicopters
Home

[Freeciv-Dev] Problem with Helicopters

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Problem with Helicopters
From: rizos@xxxxxxxx
Date: Tue, 2 Mar 1999 04:05:14 -0600 (CST)

There is a problem that occurs when a helicopter, with no hitting points 
left, attacks a unit that has no hitting points (eg. a diplomat). Then,
since handle_unit_attack_request() determines the winner/loser of a
battle based on which unit has some hitting points left, the resulting
sequence of events after the battle leads to several strange effects...
(for instance, at some point i got the two enemy units stacked together!)
[This is because both pwinner and plooser -- lines 492-493 at unithand.c --
 will get the value of pdefender]

I suggest that an helicopter with no hitting points left should be considered
as only an exploring unit and should not be allowed to attack. As a simple and
quick way to fix this, I propose to insert the following clause at the 
beginning 
of handle_unit_attack_request() - line 450 of unithand.c:

  if((is_heli_unit(punit))&&(punit->hp==0)) {
    notify_player(pplayer,"Game: Your helicopter has no hitting points left to 
attack.");
    return;
    }  

Is there any other condition in which 2 zero-hitting-points units can
be involved in a battle?

--rizos

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