summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog8
-rw-r--r--src/animatedsprite.cpp5
2 files changed, 11 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 8a75aba1..23995318 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,10 @@
-2006-08-4 Frode Lindeijer <f.lindeijer@gmail.com>
+2006-08-04 Bjørn Lindeijer <bjorn@lindeijer.nl>
+
+ * src/animatedsprite.cpp: Fixed presence of NULL actions. This is
+ doener's version of the fix, because it was more efficient in the more
+ common case.
+
+2006-08-04 Frode Lindeijer <f.lindeijer@gmail.com>
* data/graphics/tiles/desert_x3.png: Replaced the old cactus with
a nice new high-res one.
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;
+ }
}
}