diff options
author | frosch <frosch@openttd.org> | 2012-02-19 18:34:24 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2012-02-19 18:34:24 +0000 |
commit | 5167f2be29957bd96d06b0103f448b25a20691be (patch) | |
tree | 166a589e6c9b679be253b9703735cf536df1ae67 /src/newgrf_engine.cpp | |
parent | 3d6f8cd7d4ee6268c497e0f8217dce5e62e12177 (diff) | |
download | openttd-5167f2be29957bd96d06b0103f448b25a20691be.tar.xz |
(svn r23965) -Fix [FS#5070]: Refittability should never depend on the current capacity of a vehicle.
Diffstat (limited to 'src/newgrf_engine.cpp')
-rw-r--r-- | src/newgrf_engine.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/newgrf_engine.cpp b/src/newgrf_engine.cpp index 980ee33f2..3c1a93ac0 100644 --- a/src/newgrf_engine.cpp +++ b/src/newgrf_engine.cpp @@ -498,7 +498,7 @@ static uint32 VehicleGetVariable(Vehicle *v, const ResolverObject *object, byte if (v->type == VEH_TRAIN) user_def_data |= Train::From(u)->tcache.user_def_data; /* Skip empty engines */ - if (u->cargo_cap == 0) continue; + if (!u->GetEngine()->CanCarryCargo()) continue; cargo_classes |= CargoSpec::Get(u->cargo_type)->classes; common_cargoes[u->cargo_type]++; @@ -516,7 +516,7 @@ static uint32 VehicleGetVariable(Vehicle *v, const ResolverObject *object, byte /* Count subcargo types of common_cargo_type */ for (u = v; u != NULL; u = u->Next()) { /* Skip empty engines and engines not carrying common_cargo_type */ - if (u->cargo_cap == 0 || u->cargo_type != common_cargo_type) continue; + if (u->cargo_type != common_cargo_type || !u->GetEngine()->CanCarryCargo()) continue; common_subtypes[u->cargo_subtype]++; } |