Don't let ships double-retreat first on 'i' and then on 'h'

When a ship is shelled, retreat condition 'i' (injured) applies.  When
there's no return fire, 'h' (helpless) applies as well.  Ships
retreated twice in that case.  Fix that.
This commit is contained in:
Markus Armbruster 2008-12-07 09:23:30 -05:00
parent 204caeb243
commit de2651efa1

View file

@ -493,8 +493,9 @@ multifire(void)
putship(vship.shp_uid, &vship);
break;
}
if ((totaldefdam == 0) && (target == targ_ship))
if (vship.shp_rflags & RET_HELPLESS)
if (totaldefdam == 0 && target == targ_ship
&& (vship.shp_rflags & RET_HELPLESS)
&& !(vship.shp_rflags & RET_INJURED))
retreat_ship(&vship, 'h');
switch (attgp->ef_type) {
case EF_SECTOR: