From a648aff032116bb16e9122aeb83d4016b75a5c58 Mon Sep 17 00:00:00 2001 From: morkt Date: Tue, 11 Oct 2016 00:06:27 +0400 Subject: [PATCH] (FormatCatalog.LookupGame): look for archive name, too. --- GameRes/FormatCatalog.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/GameRes/FormatCatalog.cs b/GameRes/FormatCatalog.cs index 26cb5b5c..8e866c64 100644 --- a/GameRes/FormatCatalog.cs +++ b/GameRes/FormatCatalog.cs @@ -214,10 +214,12 @@ namespace GameRes /// Game title, or null if no match was found. public string LookupGame (string arc_name, string pattern = "*.exe") { + string title; + if (m_game_map.TryGetValue (Path.GetFileName (arc_name), out title)) + return title; pattern = VFS.CombinePath (VFS.GetDirectoryName (arc_name), pattern); foreach (var file in VFS.GetFiles (pattern).Select (e => Path.GetFileName (e.Name))) { - string title; if (m_game_map.TryGetValue (file, out title)) return title; }