summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-06-08 22:13:10 +0000
committerrubidium <rubidium@openttd.org>2009-06-08 22:13:10 +0000
commitafdeab52ab8331680a241c10421a4dd583182dec (patch)
treec169a4cc6fcb6d377dbb7befa298c2e4d7638178
parent050bbb4dac2412b9e30adb9d7692e0d7090a61c1 (diff)
downloadopenttd-afdeab52ab8331680a241c10421a4dd583182dec.tar.xz
(svn r16538) -Fix (r16503): when finding duplicate graphics sets favour the more complete one
-rw-r--r--src/gfxinit.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gfxinit.cpp b/src/gfxinit.cpp
index 73f2dd3d3..f471ab226 100644
--- a/src/gfxinit.cpp
+++ b/src/gfxinit.cpp
@@ -467,7 +467,9 @@ bool OBGFileScanner::AddFile(const char *filename, size_t basepath_length)
}
}
if (duplicate != NULL) {
- if (duplicate->version >= graphics->version) {
+ /* The more complete graphics set takes precedence over the version number. */
+ if ((duplicate->files == graphics->files && duplicate->version >= graphics->version) ||
+ duplicate->files > graphics->files) {
DEBUG(grf, 1, "Not adding %s (%i) as base graphics set (duplicate)", graphics->name, graphics->version);
delete graphics;
} else {