mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-02-08 07:21:53 +00:00
Change: Filter duplicate paths from valid search path list. (#11363)
This commit is contained in:
parent
0458c15060
commit
cda6f24fe8
@ -84,6 +84,8 @@ static bool IsValidSearchPath(Searchpath sp)
|
||||
static void FillValidSearchPaths(bool only_local_path)
|
||||
{
|
||||
_valid_searchpaths.clear();
|
||||
|
||||
std::set<std::string> seen{};
|
||||
for (Searchpath sp = SP_FIRST_DIR; sp < NUM_SEARCHPATHS; sp++) {
|
||||
if (only_local_path) {
|
||||
switch (sp) {
|
||||
@ -97,7 +99,11 @@ static void FillValidSearchPaths(bool only_local_path)
|
||||
}
|
||||
}
|
||||
|
||||
if (IsValidSearchPath(sp)) _valid_searchpaths.emplace_back(sp);
|
||||
if (IsValidSearchPath(sp)) {
|
||||
if (seen.count(_searchpaths[sp]) != 0) continue;
|
||||
seen.insert(_searchpaths[sp]);
|
||||
_valid_searchpaths.emplace_back(sp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user