diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-01-19 18:38:02 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-01-19 18:38:02 +0300 |
commit | faa6c2a26deb18469066a74b2d6c76fdae5931c7 (patch) | |
tree | de8392ef2c699f740ba10215bfa640570f02ae15 /src/gui/statuswindow.cpp | |
parent | c053634fdbbcc3a9da7cd0eefa7a4c78ee7e1bef (diff) | |
download | ManaVerse-faa6c2a26deb18469066a74b2d6c76fdae5931c7.tar.gz ManaVerse-faa6c2a26deb18469066a74b2d6c76fdae5931c7.tar.bz2 ManaVerse-faa6c2a26deb18469066a74b2d6c76fdae5931c7.tar.xz ManaVerse-faa6c2a26deb18469066a74b2d6c76fdae5931c7.zip |
Prevent adding double attributes to status window.
Diffstat (limited to 'src/gui/statuswindow.cpp')
-rw-r--r-- | src/gui/statuswindow.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/gui/statuswindow.cpp b/src/gui/statuswindow.cpp index b3e3f38f3..20a017a41 100644 --- a/src/gui/statuswindow.cpp +++ b/src/gui/statuswindow.cpp @@ -431,10 +431,20 @@ void StatusWindow::addAttribute(int id, const std::string &name, disp = new DerDisplay(id, name); mDAttrCont->add(disp); } - mAttrs[id] = disp; } +void StatusWindow::clearAttributes() +{ + mAttrCont->clear(); + mDAttrCont->clear(); + Attrs::iterator it = mAttrs.begin(); + Attrs::iterator it_end = mAttrs.end(); + for (; it != it_end; ++ it) + delete (*it).second; + mAttrs.clear(); +} + void StatusWindow::updateHPBar(ProgressBar *bar, bool showMax) { if (!bar) |