From 0a623bc333a54dba04271399b5d73a09498df8b2 Mon Sep 17 00:00:00 2001 From: peter1138 Date: Sun, 4 Jun 2006 17:49:16 +0000 Subject: (svn r5104) - When refitting a vehicle to its existing cargo type, don't lose the cargo onboard (useful when adding wagons to a train) --- ship_cmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ship_cmd.c') diff --git a/ship_cmd.c b/ship_cmd.c index 424d484fb..b193f954c 100644 --- a/ship_cmd.c +++ b/ship_cmd.c @@ -1061,7 +1061,7 @@ int32 CmdRefitShip(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) } if (flags & DC_EXEC) { - v->cargo_count = 0; + v->cargo_count = (v->cargo_type == new_cid) ? min(v->cargo_cap, v->cargo_count) : 0; v->cargo_type = new_cid; v->cargo_subtype = new_subtype; InvalidateWindow(WC_VEHICLE_DETAILS, v->index); -- cgit v1.2.3-70-g09d2