]> git.pond.sub.org Git - empserver/commitdiff
Don't let ships double-retreat first on 'i' and then on 'h'
authorMarkus Armbruster <armbru@pond.sub.org>
Sun, 7 Dec 2008 14:23:30 +0000 (09:23 -0500)
committerMarkus Armbruster <armbru@pond.sub.org>
Sun, 7 Dec 2008 14:26:26 +0000 (09:26 -0500)
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

index 0df7e5e981d68d989214649e998e96e2d1141852..abdf4026c1b4dbaafcfada39305800d6860001a4 100644 (file)
@@ -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);