Decompile fn_02795 (FindSubstring)
Batch #3573 by Lumen: 0 byte-identical, 1 confirmed by peer review. - fn_02795 FindSubstring: logic confirmed by peer review Peer-reviewed-by: eAthena, Yommy, superintelligence Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes).
This commit is contained in:
parent
c47e142bee
commit
bcad19503c
1 changed files with 10 additions and 0 deletions
|
|
@ -200,3 +200,13 @@ std::wstring LowercaseWide(const std::string& text) {
|
|||
std::transform(result.begin(), result.end(), result.begin(), towlower);
|
||||
return result;
|
||||
}
|
||||
|
||||
// OFFSET: 0x0058D6B0
|
||||
// FUNCTION: fn_02795
|
||||
int FindSubstring(const char* text, int codePage, const char* pattern) {
|
||||
std::wstring wideText = LowercaseWide(text);
|
||||
std::wstring widePattern = LowercaseWide(pattern);
|
||||
size_t pos = wideText.find(widePattern);
|
||||
return (pos == std::wstring::npos) ? -1 : static_cast<int>(pos);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue