From a1dea147bba16006b1fb45f9ae22b7d7a008d99e Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Tue, 18 Feb 2014 10:56:44 +0200 Subject: WME: Remove translation tags from names found by the fallback detector Fixes cases like bug #6532 --- engines/wintermute/wintermute.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'engines/wintermute') diff --git a/engines/wintermute/wintermute.cpp b/engines/wintermute/wintermute.cpp index 31e5995e2e..81b6e53c9f 100644 --- a/engines/wintermute/wintermute.cpp +++ b/engines/wintermute/wintermute.cpp @@ -365,6 +365,17 @@ bool WintermuteEngine::getGameInfo(const Common::FSList &fslist, Common::String name = value; } else if (key == "CAPTION") { retVal = true; + // Remove any translation tags, if they are included in the game description. + // This can potentially remove parts of a string that has translation tags + // and contains a "/" in its description (e.g. /tag/Name start / name end will + // result in "name end"), but it's a very rare case, and this code is just used + // for fallback anyway. + if (value.hasPrefix("/")) { + value.deleteChar(0); + while (value.contains("/")) { + value.deleteChar(0); + } + } caption = value; } } -- cgit v1.2.3