Decompile fn_06989 (CEZ2STREffectMgr::EffectId)
Batch #15545 by Yommy: 0 byte-identical, 1 confirmed by peer review. - fn_06989 CEZ2STREffectMgr::EffectId: logic confirmed by peer review Peer-reviewed-by: ragnarok-clanker, eAthena 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
ec7b15a59d
commit
763c40324b
1 changed files with 3 additions and 5 deletions
|
|
@ -543,12 +543,10 @@ EZ2STREffectInfo* CEZ2STREffectMgr::FindById(int id) {
|
|||
// FUNCTION: fn_06989
|
||||
int CEZ2STREffectMgr::EffectId(const std::string& name) {
|
||||
std::string key = name;
|
||||
for (char& c : key) {
|
||||
c = static_cast<char>(std::tolower(static_cast<unsigned char>(c)));
|
||||
}
|
||||
std::transform(key.begin(), key.end(), key.begin(), [](unsigned char c) { return static_cast<char>(std::tolower(c)); });
|
||||
|
||||
const auto found = this->effects.lower_bound(key);
|
||||
if (found != this->effects.end() && key.compare(found->first) >= 0) {
|
||||
const auto found = this->effects.find(key);
|
||||
if (found != this->effects.end()) {
|
||||
return found->second.id + 10000;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue