changeset 6114:466aa6880749 draft

(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.
author peter1138 <peter1138@openttd.org>
date Thu, 22 Feb 2007 22:53:49 +0000
parents 5cf0c6849eee
children c3ae49ab2bb2
files src/train_cmd.cpp
diffstat 1 files changed, 1 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/train_cmd.cpp
+++ b/src/train_cmd.cpp
@@ -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;
 }