From e16ea9b7582056a3483f5de6553573fccc792d15 Mon Sep 17 00:00:00 2001 From: peter1138 Date: Sat, 12 May 2007 07:05:34 +0000 Subject: (svn r9828) -Codechange: [NewGRF] Add support for changing cargo capacity with callback 36. This is set on construction for ships and roadvehicles, and whenever carriages are attached for trains. --- src/ship_cmd.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/ship_cmd.cpp') diff --git a/src/ship_cmd.cpp b/src/ship_cmd.cpp index 67b18b5e9..ef887873d 100644 --- a/src/ship_cmd.cpp +++ b/src/ship_cmd.cpp @@ -878,6 +878,8 @@ int32 CmdBuildShip(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) v->vehicle_flags = 0; if (e->flags & ENGINE_EXCLUSIVE_PREVIEW) SETBIT(v->vehicle_flags, VF_BUILT_AS_PROTOTYPE); + v->cargo_cap = GetVehicleProperty(v, 0x0D, svi->capacity); + VehiclePositionChanged(v); InvalidateWindowData(WC_VEHICLE_DEPOT, v->tile); @@ -1090,7 +1092,7 @@ int32 CmdRefitShip(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) } if (capacity == CALLBACK_FAILED) { - capacity = ShipVehInfo(v->engine_type)->capacity; + capacity = GetVehicleProperty(v, 0x0D, ShipVehInfo(v->engine_type)->capacity); } _returned_refit_capacity = capacity; -- cgit v1.2.3-54-g00ecf