From de2651efa109f4d520439f270f43626f7f5b003b Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Sun, 7 Dec 2008 09:23:30 -0500 Subject: [PATCH] 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. --- src/lib/commands/mfir.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/lib/commands/mfir.c b/src/lib/commands/mfir.c index 0df7e5e9..abdf4026 100644 --- a/src/lib/commands/mfir.c +++ b/src/lib/commands/mfir.c @@ -493,9 +493,10 @@ multifire(void) putship(vship.shp_uid, &vship); break; } - if ((totaldefdam == 0) && (target == targ_ship)) - if (vship.shp_rflags & RET_HELPLESS) - retreat_ship(&vship, 'h'); + 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: putsect(&fsect);