]> git.pond.sub.org Git - empserver/commit - src/lib/subs/retreat.c
retreat: Fix group retreat after failed board sinks ship
authorMarkus Armbruster <armbru@pond.sub.org>
Mon, 12 Jan 2015 20:19:02 +0000 (21:19 +0100)
committerMarkus Armbruster <armbru@pond.sub.org>
Mon, 2 Mar 2015 07:20:51 +0000 (08:20 +0100)
commitfff476ac4b958cbfecf4690590df9fa8a9db21c0
tree9da4e9c6582b63a8823649dd7d3939caf97cea14
parent7b3d541c0d6ec407f911e404df04b227dcf1861e
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>
include/retreat.h
src/lib/commands/boar.c
src/lib/commands/bomb.c
src/lib/commands/laun.c
src/lib/commands/mfir.c
src/lib/commands/sona.c
src/lib/commands/torp.c
src/lib/subs/retreat.c
tests/retreat/01-retreat-1
tests/retreat/final.xdump
tests/retreat/journal.log