summaryrefslogtreecommitdiff
path: root/src/localplayer.cpp
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2009-08-01 12:53:00 -0600
committerJared Adams <jaxad0127@gmail.com>2009-08-01 12:53:00 -0600
commitac839db81173f6e54ab4f3b74a4c90e3a5072d41 (patch)
treef097f74e431746e7b199236cae8797c1dc77f651 /src/localplayer.cpp
parent907b4a126e16c56d7b372ea7fa0ed750e4302133 (diff)
downloadmana-ac839db81173f6e54ab4f3b74a4c90e3a5072d41.tar.gz
mana-ac839db81173f6e54ab4f3b74a4c90e3a5072d41.tar.bz2
mana-ac839db81173f6e54ab4f3b74a4c90e3a5072d41.tar.xz
mana-ac839db81173f6e54ab4f3b74a4c90e3a5072d41.zip
Fix a compile error under Windows
Diffstat (limited to 'src/localplayer.cpp')
-rw-r--r--src/localplayer.cpp8
1 files changed, 6 insertions, 2 deletions
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);
}