summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChuck Miller <shadowmil@gmail.com>2010-07-18 23:31:36 -0400
committerChuck Miller <shadowmil@gmail.com>2010-07-18 23:35:32 -0400
commit335eec717f6189c01d8217dd2c4f4e74a171d9a5 (patch)
treebdaf7ff7aa6d7d2efe016874160462b691ae59ba
parent26b2741e2ef1c2d24115a7cdd88a1fa0dc0e19a2 (diff)
downloadmana-335eec717f6189c01d8217dd2c4f4e74a171d9a5.tar.gz
mana-335eec717f6189c01d8217dd2c4f4e74a171d9a5.tar.bz2
mana-335eec717f6189c01d8217dd2c4f4e74a171d9a5.tar.xz
mana-335eec717f6189c01d8217dd2c4f4e74a171d9a5.zip
Fix runtime crash from bad event keys
Reviewed-by: Jared Adams
-rw-r--r--src/gui/statuswindow.cpp21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/gui/statuswindow.cpp b/src/gui/statuswindow.cpp
index ec35bb9e..3dd50232 100644
--- a/src/gui/statuswindow.cpp
+++ b/src/gui/statuswindow.cpp
@@ -227,31 +227,36 @@ void StatusWindow::event(const std::string &channel, const Mana::Event &event)
case MONEY:
mMoneyLabel->setCaption(strprintf(_("Money: %s"),
- Units::formatCurrency(event.getInt("value")).c_str()));
+ Units::formatCurrency(
+ event.getInt("newValue")).c_str()));
mMoneyLabel->adjustSize();
break;
case CHAR_POINTS:
- mCharacterPointsLabel->setCaption(strprintf(_("Character points: %d"),
- event.getInt("value")));
+ mCharacterPointsLabel->setCaption(strprintf(
+ _("Character points: %d"),
+ event.getInt("newValue")));
mCharacterPointsLabel->adjustSize();
// Update all attributes
- for (Attrs::iterator it = mAttrs.begin(); it != mAttrs.end(); it++)
+ for (Attrs::iterator it = mAttrs.begin();
+ it != mAttrs.end(); it++)
it->second->update();
break;
case CORR_POINTS:
- mCorrectionPointsLabel->setCaption(strprintf(_("Correction points: %d"),
- event.getInt("value")));
+ mCorrectionPointsLabel->setCaption(strprintf(
+ _("Correction points: %d"),
+ event.getInt("newValue")));
mCorrectionPointsLabel->adjustSize();
// Update all attributes
- for (Attrs::iterator it = mAttrs.begin(); it != mAttrs.end(); it++)
+ for (Attrs::iterator it = mAttrs.begin();
+ it != mAttrs.end(); it++)
it->second->update();
break;
case LEVEL:
mLvlLabel->setCaption(strprintf(_("Level: %d"),
- event.getInt("value")));
+ event.getInt("newValue")));
mLvlLabel->adjustSize();
break;
}