summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/gui/windows/skilldialog.cpp10
-rw-r--r--src/gui/windows/skilldialog.h2
-rw-r--r--src/net/eathena/skillhandler.cpp4
3 files changed, 15 insertions, 1 deletions
diff --git a/src/gui/windows/skilldialog.cpp b/src/gui/windows/skilldialog.cpp
index b2902556e..a7ca3b8a0 100644
--- a/src/gui/windows/skilldialog.cpp
+++ b/src/gui/windows/skilldialog.cpp
@@ -201,6 +201,16 @@ void SkillDialog::clearSkills()
mSkills.clear();
}
+void SkillDialog::hideSkills()
+{
+ FOR_EACH (SkillMap::iterator, it, mSkills)
+ {
+ SkillInfo *const info = (*it).second;
+ if (info)
+ info->visible = false;
+ }
+}
+
void SkillDialog::loadSkills()
{
clearSkills();
diff --git a/src/gui/windows/skilldialog.h b/src/gui/windows/skilldialog.h
index 8e2c325a0..c67d69b10 100644
--- a/src/gui/windows/skilldialog.h
+++ b/src/gui/windows/skilldialog.h
@@ -73,6 +73,8 @@ class SkillDialog final : public Window,
void clearSkills();
+ void hideSkills();
+
void loadSkills();
bool updateSkill(const int id,
diff --git a/src/net/eathena/skillhandler.cpp b/src/net/eathena/skillhandler.cpp
index 1f2d9a8ba..a66987f71 100644
--- a/src/net/eathena/skillhandler.cpp
+++ b/src/net/eathena/skillhandler.cpp
@@ -100,10 +100,12 @@ void SkillHandler::useMap(const int id, const std::string &map) const
void SkillHandler::processPlayerSkills(Net::MessageIn &msg)
{
- msg.readInt16(); // length
+ msg.readInt16("len");
const int skillCount = (msg.getLength() - 4) / 37;
int updateSkill = 0;
+ if (skillDialog)
+ skillDialog->hideSkills();
for (int k = 0; k < skillCount; k++)
{
const int skillId = msg.readInt16("skill id");