From ac839db81173f6e54ab4f3b74a4c90e3a5072d41 Mon Sep 17 00:00:00 2001 From: Jared Adams Date: Sat, 1 Aug 2009 12:53:00 -0600 Subject: Fix a compile error under Windows --- src/localplayer.cpp | 8 ++++++-- src/localplayer.h | 5 +++-- 2 files changed, 9 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/localplayer.cpp b/src/localplayer.cpp index ff3267ad..cb7515dc 100644 --- a/src/localplayer.cpp +++ b/src/localplayer.cpp @@ -749,7 +749,9 @@ void LocalPlayer::raiseAttribute(size_t attr) { // we assume that the server allows the change. When not we will undo it later. mCharacterPoints--; - mAttributeBase.at(attr)++; + IntMap::iterator it = mAttributeBase.find(attr); + if (it != mAttributeBase.end()) + (*it).second++; Net::getPlayerHandler()->increaseAttribute(attr); } @@ -758,7 +760,9 @@ void LocalPlayer::lowerAttribute(size_t attr) // we assume that the server allows the change. When not we will undo it later. mCorrectionPoints--; mCharacterPoints++; - mAttributeBase.at(attr)--; + IntMap::iterator it = mAttributeBase.find(attr); + if (it != mAttributeBase.end()) + (*it).second--; Net::getPlayerHandler()->decreaseAttribute(attr); } diff --git a/src/localplayer.h b/src/localplayer.h index a3ed5f29..fa0b8984 100644 --- a/src/localplayer.h +++ b/src/localplayer.h @@ -373,8 +373,9 @@ class LocalPlayer : public Player int mLastTarget; /** Time stamp of last targeting action, -1 if none. */ // Character status: - std::map mAttributeBase; - std::map mAttributeEffective; + typedef std::map IntMap; + IntMap mAttributeBase; + IntMap mAttributeEffective; std::map > mSkillExp; int mCharacterPoints; int mCorrectionPoints; -- cgit v1.2.3-70-g09d2