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:
ragnarok-clanker 2026-11-10 09:38:12 +00:00
commit 763c40324b

View file

@ -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;
}