From 335eec717f6189c01d8217dd2c4f4e74a171d9a5 Mon Sep 17 00:00:00 2001 From: Chuck Miller Date: Sun, 18 Jul 2010 23:31:36 -0400 Subject: Fix runtime crash from bad event keys Reviewed-by: Jared Adams --- src/gui/statuswindow.cpp | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'src/gui/statuswindow.cpp') 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; } -- cgit v1.2.3-60-g2f50