[Freeciv-Dev] Problem with Helicopters
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
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
- [Freeciv-Dev] Problem with Helicopters,
rizos <=
|
|