fire: Fix ship retreat when helpless

Two bugs.  First, multifire() checks the condition only for surface
ships, not for submarines.  Second, multifire() neglects to write back
the ship after retreating it.  The player is told the ship retreats,
but it actually stays where it is.

Broken since retreat was added in Chainsaw.  Previous fixes (commit
8065fe8, v4.3.1 and commit de2651e, v4.3.19) "fixed" only the
bulletin.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
This commit is contained in:
Markus Armbruster 2014-01-08 19:16:21 +01:00
parent 30ce78d6df
commit 6d2244093a
3 changed files with 24 additions and 26 deletions

View file

@ -446,13 +446,13 @@ multifire(void)
&& (vship.shp_rflags & RET_DCHRGED)
&& !(vship.shp_rflags & RET_INJURED))
retreat_ship(&vship, 'd');
else if (totaldefdam == 0
&& (vship.shp_rflags & RET_HELPLESS)
&& !(vship.shp_rflags & RET_INJURED))
retreat_ship(&vship, 'h');
putship(vship.shp_uid, &vship);
break;
}
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);