feat: fire SKILL_LINES_CHANGED event when player skills update

Detect changes in player skill values after extractSkillFields() and fire
SKILL_LINES_CHANGED when any skill value changes. Used by profession
tracking addons and skill bar displays.
This commit is contained in:
Kelsi 2026-03-20 21:57:27 -07:00
parent d68ef2ceb6
commit fc182f8653

View file

@ -24442,7 +24442,19 @@ void GameHandler::extractSkillFields(const std::map<uint16_t, uint32_t>& fields)
}
}
bool skillsChanged = (newSkills.size() != playerSkills_.size());
if (!skillsChanged) {
for (const auto& [id, sk] : newSkills) {
auto it = playerSkills_.find(id);
if (it == playerSkills_.end() || it->second.value != sk.value) {
skillsChanged = true;
break;
}
}
}
playerSkills_ = std::move(newSkills);
if (skillsChanged && addonEventCallback_)
addonEventCallback_("SKILL_LINES_CHANGED", {});
}
void GameHandler::extractExploredZoneFields(const std::map<uint16_t, uint32_t>& fields) {