Wipe orders when ship, plane, land unit or nuke changes owner

Use new unit_wipe_orders() for violent takeover (takeover_unit() on
behalf of assault, attack, board, lboard, paradrop and pboard), and
peaceful takeover (unit_give_away() on behalf of arm, disarm, load,
unload, lload, lunload, scrap, scuttle, tend, trade).

Before, takeover_unit() cleared only group, mission and ship retreat
orders, and unit_give_away() only group and mission.  Orders that
weren't cleared:

* Mission op area (visible in xdump)

* Ship autonav orders

* Ship sail path including ship to follow and mobility quota

* Plane range limit

* Land unit retreat orders and retreat percentage
This commit is contained in:
Markus Armbruster 2008-09-14 19:32:34 -04:00
parent 5f6e27ff80
commit e7ce50405e
4 changed files with 57 additions and 8 deletions

View file

@ -372,8 +372,6 @@ check_trade(void)
tg.plane.pln_land = -1;
break;
case EF_SHIP:
tg.ship.shp_rflags = 0;
memset(tg.ship.shp_rpath, 0, sizeof(tg.ship.shp_rpath));
break;
case EF_LAND:
tg.land.lnd_x = trade.trd_x;