diff options
author | frosch <frosch@openttd.org> | 2009-10-31 17:48:09 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2009-10-31 17:48:09 +0000 |
commit | 67cae40ec158c5df92348ce37d3ed2832abd5426 (patch) | |
tree | acc65e62de519d9e63a268178dbe5df45192e905 /src/aircraft_cmd.cpp | |
parent | 4ee589d86d02f6e320f195fc1b4e2667853a01ec (diff) | |
download | openttd-67cae40ec158c5df92348ce37d3ed2832abd5426.tar.xz |
(svn r17926) -Fix (r9352): Make the decision whether aircraft carry mail consistent. Now always the cargo class decides.
Diffstat (limited to 'src/aircraft_cmd.cpp')
-rw-r--r-- | src/aircraft_cmd.cpp | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/src/aircraft_cmd.cpp b/src/aircraft_cmd.cpp index 65c3f6ff1..d90320f07 100644 --- a/src/aircraft_cmd.cpp +++ b/src/aircraft_cmd.cpp @@ -360,11 +360,7 @@ CommandCost CmdBuildAircraft(TileIndex tile, DoCommandFlag flags, uint32 p1, uin v->InvalidateNewGRFCacheOfChain(); - v->cargo_cap = GetVehicleCapacity(v); - if (v->cargo_type != CT_PASSENGERS) { - /* Set the 'second compartent' capacity to none */ - u->cargo_cap = 0; - } + v->cargo_cap = GetVehicleCapacity(v, &u->cargo_cap); v->InvalidateNewGRFCacheOfChain(); @@ -505,12 +501,6 @@ CommandCost CmdRefitAircraft(TileIndex tile, DoCommandFlag flags, uint32 p1, uin CommandCost cost = RefitVehicle(v, true, new_cid, new_subtype, flags); if (flags & DC_EXEC) { - const Engine *e = Engine::Get(v->engine_type); - Vehicle *u = v->Next(); - uint mail = IsCargoInClass(new_cid, CC_PASSENGERS) ? e->u.air.mail_capacity : 0; - u->cargo_cap = mail; - u->cargo.Truncate(v->cargo_type == new_cid ? mail : 0); - v->colourmap = PAL_NONE; // invalidate vehicle colour map SetWindowDirty(WC_VEHICLE_DETAILS, v->index); SetWindowDirty(WC_VEHICLE_DEPOT, v->tile); |