(svn r9875) -Fix (r9828): Only set carriage capacity if the wagon has not been refitted.
authorpeter1138
Sat, 19 May 2007 10:29:51 +0000
changeset 7140 422457e07b54
parent 7139 4ae3ab180d05
child 7141 470199c6dda0
(svn r9875) -Fix (r9828): Only set carriage capacity if the wagon has not been refitted.
src/train_cmd.cpp
--- a/src/train_cmd.cpp	Sat May 19 09:40:18 2007 +0000
+++ b/src/train_cmd.cpp	Sat May 19 10:29:51 2007 +0000
@@ -221,7 +221,10 @@
 			}
 		}
 
-		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;