summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2007-05-19 10:29:51 +0000
committerpeter1138 <peter1138@openttd.org>2007-05-19 10:29:51 +0000
commitda204ca17f10b7e101a4bae8b5de5f9c05474ee7 (patch)
tree7695a039d4a66b3c13c8739596a9e721f46ff265
parent8f0f090c5139465bb2db1bf280886a563a68385d (diff)
downloadopenttd-da204ca17f10b7e101a4bae8b5de5f9c05474ee7.tar.xz
(svn r9875) -Fix (r9828): Only set carriage capacity if the wagon has not been refitted.
-rw-r--r--src/train_cmd.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp
index 3329f8d0a..e8437bece 100644
--- a/src/train_cmd.cpp
+++ b/src/train_cmd.cpp
@@ -221,7 +221,10 @@ void TrainConsistChanged(Vehicle* v)
}
}
- u->cargo_cap = GetVehicleProperty(u, 0x14, rvi_u->capacity);
+ if (u->cargo_type == rvi_u->cargo_type && u->cargo_subtype == 0) {
+ /* Set cargo capacity if we've not been refitted */
+ u->cargo_cap = GetVehicleProperty(u, 0x14, rvi_u->capacity);
+ }
/* check the vehicle length (callback) */
uint16 veh_len = CALLBACK_FAILED;