From 627c9a7a762ebaf2ae65c5938986f24a5400d52b Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 18 Sep 2014 19:02:01 +0300 Subject: Add empty skill if need add skill duration/cooldown and skin not created/loaded. --- src/gui/windows/skilldialog.cpp | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/gui/windows/skilldialog.cpp b/src/gui/windows/skilldialog.cpp index ee82445f7..7176c4103 100644 --- a/src/gui/windows/skilldialog.cpp +++ b/src/gui/windows/skilldialog.cpp @@ -430,15 +430,21 @@ SkillInfo* SkillDialog::getSkillByItem(const int itemId) const void SkillDialog::setSkillDuration(const int id, const int duration) { SkillMap::const_iterator it = mSkills.find(id); + SkillInfo *info = nullptr; + if (it == mSkills.end()) + { + addSkill(id, "", 0, 0, false, SkillType::Unknown, 0); + it = mSkills.find(id); + } if (it != mSkills.end()) { - SkillInfo *const info = (*it).second; - if (info) - { - info->duration = duration; - info->durationTime = tick_time; - addSkillDuration(info); - } + info = (*it).second; + } + if (info) + { + info->duration = duration; + info->durationTime = tick_time; + addSkillDuration(info); } } -- cgit v1.2.3-70-g09d2