commands: Always put ship or land unit before retreating it

boar() puts before retreating, the other callers afterwards.  Subtle
difference, because putting resets the owner of the dead to POGO.

Until the commit before previous, retreat didn't fully work after put.
Now it does.  The subtle difference between boar() and the other
callers still exists.  It's better to do it the same everywhere, as
subtle differences invite bugs.  Since changing boar() is not
practical, change the others.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
This commit is contained in:
Markus Armbruster 2015-01-12 22:19:32 +01:00
parent 32b611eb8d
commit f4d8d64bb3
4 changed files with 5 additions and 5 deletions

View file

@ -276,9 +276,9 @@ launch_missile(struct plnstr *pp)
shipdamage(&target_ship, dam);
if (target_ship.shp_effic < SHIP_MINEFF)
pr("%s sunk!\n", prship(&target_ship));
putship(target_ship.shp_uid, &target_ship);
if (dam && (target_ship.shp_rflags & RET_INJURED))
retreat_ship(&target_ship, target_ship.shp_own, 'i');
putship(target_ship.shp_uid, &target_ship);
}
return RET_OK;
}