Work around eFindMap_FuzzyMatch never actually being returned in TF2.
This commit is contained in:
parent
60ac7e23d0
commit
80838af4a2
@ -1252,7 +1252,16 @@ SMFindMapResult CHalfLife2::FindMap(char *pMapName, int nMapNameMax)
|
|||||||
return SMFindMapResult::FuzzyMatch;
|
return SMFindMapResult::FuzzyMatch;
|
||||||
}
|
}
|
||||||
#elif SOURCE_ENGINE == SE_TF2
|
#elif SOURCE_ENGINE == SE_TF2
|
||||||
return static_cast<SMFindMapResult>(engine->FindMap(pMapName, nMapNameMax));
|
// Save off name passed in so that we can compare to output.
|
||||||
|
// There is a bug where eFindMap_FuzzyMap is never returned, even for fuzzy matches.
|
||||||
|
char *pOriginal = sm_strdup(pMapName);
|
||||||
|
SMFindMapResult res = static_cast<SMFindMapResult>(engine->FindMap(pMapName, nMapNameMax));
|
||||||
|
bool bExactMatch = strcmp(pOriginal, pMapName) == 0;
|
||||||
|
delete [] pOriginal;
|
||||||
|
if (res == SMFindMapResult::Found && !bExactMatch)
|
||||||
|
return SMFindMapResult::FuzzyMatch;
|
||||||
|
else
|
||||||
|
return res;
|
||||||
#else
|
#else
|
||||||
return engine->IsMapValid(pMapName) == 0 ? SMFindMapResult::NotFound : SMFindMapResult::Found;
|
return engine->IsMapValid(pMapName) == 0 ? SMFindMapResult::NotFound : SMFindMapResult::Found;
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user