retreat: Fix group retreat after failed board sinks ship
Group retreat still doesn't work, because when boar() passes a sunk ship to retreat_ship(), its owner has been reset to POGO already. This makes it impossible to find the group to retreat. Instead, it attempts to retreat ships that sank in the same sector with group retreat orders and with the same fleet letter assigned. If any exist, shp_may_nav() oopses, and prevents actual retreat of these ghosts. The other retreat conditions don't have this problem, because they call putship(), which resets the owner, only after retreat_ship(). Making boar() work the same is not practical. Instead, add an owner parameter to retreat_ship(), and for symmetry also to retreat_land(). Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
This commit is contained in:
parent
7b3d541c0d
commit
fff476ac4b
11 changed files with 31 additions and 29 deletions
|
@ -427,11 +427,11 @@ multifire(void)
|
|||
if (vship.shp_effic < SHIP_MINEFF)
|
||||
pr("%s sunk!\n", prsub(&vship));
|
||||
if (dam && (vship.shp_rflags & RET_INJURED))
|
||||
retreat_ship(&vship, 'i');
|
||||
retreat_ship(&vship, vict, 'i');
|
||||
else if (target == targ_sub && (vship.shp_rflags & RET_DCHRGED))
|
||||
retreat_ship(&vship, 'd');
|
||||
retreat_ship(&vship, vict, 'd');
|
||||
else if (totaldefdam == 0 && (vship.shp_rflags & RET_HELPLESS))
|
||||
retreat_ship(&vship, 'h');
|
||||
retreat_ship(&vship, vict, 'h');
|
||||
putship(vship.shp_uid, &vship);
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue