summaryrefslogtreecommitdiff
path: root/src/cargotype.cpp
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2007-05-18 21:50:32 +0000
committerpeter1138 <peter1138@openttd.org>2007-05-18 21:50:32 +0000
commitb8a82dcb05e1ccd86cd8cf8fa8fb8d90c62d15a0 (patch)
treea1ec583ac7a76b43029bc08ea574a40ea4bdf1a6 /src/cargotype.cpp
parent49570edfe97df43654759e9d9e492137c0fe4c2a (diff)
downloadopenttd-b8a82dcb05e1ccd86cd8cf8fa8fb8d90c62d15a0.tar.xz
(svn r9871) -Fix (r8826): Some cargo costs were wrong for different climates. Multiple definitions of the same cargo type are sometimes required.
Diffstat (limited to 'src/cargotype.cpp')
-rw-r--r--src/cargotype.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/cargotype.cpp b/src/cargotype.cpp
index 6d8a2ca63..1b10b680d 100644
--- a/src/cargotype.cpp
+++ b/src/cargotype.cpp
@@ -33,6 +33,14 @@ void SetupCargoForClimate(LandscapeID l)
for (CargoID i = 0; i < lengthof(_default_climate_cargo[l]); i++) {
CargoLabel cl = _default_climate_cargo[l][i];
+ /* Bzzt: check if cl is just an index into the cargo table */
+ if (cl < lengthof(_default_cargo)) {
+ /* Copy the indexed cargo */
+ _cargo[i] = _default_cargo[cl];
+ SETBIT(_cargo_mask, i);
+ continue;
+ }
+
/* Loop through each of the default cargo types to see if
* the label matches */
for (uint j = 0; j < lengthof(_default_cargo); j++) {