(svn r8850) -Codechange: Use the cargo type's is_freight flag instead of checking the cargo type to determine if the cargo type is freight cargo type cargo type.
authorpeter1138
Thu, 22 Feb 2007 22:53:49 +0000
changeset 6114 f15b4f5533b2
parent 6113 a10ede03ac58
child 6115 10cd00d157ef
(svn r8850) -Codechange: Use the cargo type's is_freight flag instead of checking the cargo type to determine if the cargo type is freight cargo type cargo type.
src/train_cmd.cpp
--- a/src/train_cmd.cpp	Thu Feb 22 22:09:51 2007 +0000
+++ b/src/train_cmd.cpp	Thu Feb 22 22:53:49 2007 +0000
@@ -49,8 +49,7 @@
  */
 byte FreightWagonMult(CargoID cargo)
 {
-	// XXX NewCargos introduces a specific "is freight" flag for this test.
-	if (cargo == CT_PASSENGERS || cargo == CT_MAIL) return 1;
+	if (!GetCargo(cargo)->is_freight) return 1;
 	return _patches.freight_trains;
 }