summaryrefslogtreecommitdiff
path: root/src/newgrf_cargo.cpp
diff options
context:
space:
mode:
authorPeter Nelson <peter1138@openttd.org>2021-06-04 12:52:00 +0100
committerPeterN <peter@fuzzle.org>2021-06-12 08:05:59 +0100
commitf1328db063fe0808a55e7ed76304491b84916146 (patch)
tree1affc16bd7abdaea4fcc143316a54c29497402de /src/newgrf_cargo.cpp
parentc562b4c52754ea51418f5b4ecc46a36e14f849f0 (diff)
downloadopenttd-f1328db063fe0808a55e7ed76304491b84916146.tar.xz
Codechange: Deduplicate ResolveReal() for resolvers that don't use real sprite groups.
This may change behaviour when multiple loading/loaded stages are provided, as the various copies checked in different orders, however only one result is expected in these cases anyway.
Diffstat (limited to 'src/newgrf_cargo.cpp')
-rw-r--r--src/newgrf_cargo.cpp12
1 files changed, 0 insertions, 12 deletions
diff --git a/src/newgrf_cargo.cpp b/src/newgrf_cargo.cpp
index 105a2b252..70b1a18d9 100644
--- a/src/newgrf_cargo.cpp
+++ b/src/newgrf_cargo.cpp
@@ -19,22 +19,10 @@ struct CargoResolverObject : public ResolverObject {
CargoResolverObject(const CargoSpec *cs, CallbackID callback = CBID_NO_CALLBACK, uint32 callback_param1 = 0, uint32 callback_param2 = 0);
- const SpriteGroup *ResolveReal(const RealSpriteGroup *group) const override;
-
GrfSpecFeature GetFeature() const override;
uint32 GetDebugID() const override;
};
-/* virtual */ const SpriteGroup *CargoResolverObject::ResolveReal(const RealSpriteGroup *group) const
-{
- /* Cargo action 2s should always have only 1 "loaded" state, but some
- * times things don't follow the spec... */
- if (!group->loaded.empty()) return group->loaded[0];
- if (!group->loading.empty()) return group->loading[0];
-
- return nullptr;
-}
-
GrfSpecFeature CargoResolverObject::GetFeature() const
{
return GSF_CARGOES;