summaryrefslogtreecommitdiff
path: root/src/animatedsprite.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2006-08-04 17:56:11 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2006-08-04 17:56:11 +0000
commit87c52c1d627260e6e3ce743e48f8fa242547b521 (patch)
tree1a8625f05acdf9cdab8494909632d5208fdb2afe /src/animatedsprite.cpp
parentfe52df028d5e169bf983149e966b953b4b67fe43 (diff)
downloadmana-client-87c52c1d627260e6e3ce743e48f8fa242547b521.tar.gz
mana-client-87c52c1d627260e6e3ce743e48f8fa242547b521.tar.bz2
mana-client-87c52c1d627260e6e3ce743e48f8fa242547b521.tar.xz
mana-client-87c52c1d627260e6e3ce743e48f8fa242547b521.zip
Fixed presence of NULL actions. This is doener's version of the fix, because it
was more efficient in the more common case.
Diffstat (limited to 'src/animatedsprite.cpp')
-rw-r--r--src/animatedsprite.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/animatedsprite.cpp b/src/animatedsprite.cpp
index 3ea400ac..02acc8be 100644
--- a/src/animatedsprite.cpp
+++ b/src/animatedsprite.cpp
@@ -214,7 +214,10 @@ AnimatedSprite::substituteAction(SpriteAction complete,
{
if (mActions.find(complete) == mActions.end())
{
- mActions[complete] = mActions[with];
+ ActionIterator i = mActions.find(with);
+ if (i != mActions.end()) {
+ mActions[complete] = i->second;
+ }
}
}