Decompile fn_03940 (CCharacterLinkedUserDataMgr::Save'::8'::SaveUseSkillLevel::operator())

Batch #6629 by System4z: 0 byte-identical, 1 confirmed by peer review.

- fn_03940 `CCharacterLinkedUserDataMgr::Save'::`8'::SaveUseSkillLevel::operator(): logic confirmed by peer review

Peer-reviewed-by: alisonrag, SapitoSucio, vinnyamancio
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-10-31 01:27:57 +00:00
commit 3830bd03ca

View file

@ -43,19 +43,27 @@ void CCharacterLinkedUserDataMgr::Save(CharacterConfigSave& context, const char*
if (g_session.GetOption(7) != 0) {
Json::Value values;
context.skills.ForEachGrouped([&](CSkillInfo* skill) {
const int id = static_cast<int>(skill->id);
const int level = context.UseLevel(id);
struct SaveUseSkillLevel {
const CharacterConfigSave* context;
Json::Value* values;
if (level != 0) {
Json::Value value;
value["SKID"] = id;
value["SKLv"] = level;
values.append(value);
// OFFSET: 0x005E7AE0
// FUNCTION: fn_03940
bool operator()(CSkillInfo* skill) const {
const int id = static_cast<int>(skill->id);
const int level = reinterpret_cast<const CharacterConfigSave*>(&g_session)->UseLevel(id);
if (level != 0) {
Json::Value value;
value["SKID"] = id;
value["SKLv"] = level;
this->values->append(value);
}
return true;
}
};
return true;
});
context.skills.ForEachGrouped(SaveUseSkillLevel{&context, &values});
data["UseSkillInfo"] = values;
}