summaryrefslogtreecommitdiff
path: root/src/resources/action.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2007-10-23 08:02:22 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2007-10-23 08:02:22 +0000
commit8eda6c18fd391e34f180aaece96140a374f274f9 (patch)
tree9598ebf5280790951b30befe9c84d4bba57198e4 /src/resources/action.cpp
parentc9f618b5c50f759cf172d8e37063ef56e05812cf (diff)
downloadmana-client-8eda6c18fd391e34f180aaece96140a374f274f9.tar.gz
mana-client-8eda6c18fd391e34f180aaece96140a374f274f9.tar.bz2
mana-client-8eda6c18fd391e34f180aaece96140a374f274f9.tar.xz
mana-client-8eda6c18fd391e34f180aaece96140a374f274f9.zip
Merged changesets 3653, 3655-3657, 3659-3560, 3671-3672 from trunk to
0.0. Mostly memory leak fixes by Guillaume.
Diffstat (limited to 'src/resources/action.cpp')
-rw-r--r--src/resources/action.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/resources/action.cpp b/src/resources/action.cpp
index 247455db..6b3c2f52 100644
--- a/src/resources/action.cpp
+++ b/src/resources/action.cpp
@@ -45,10 +45,11 @@ Action::getAnimation(int direction) const
{
Animations::const_iterator i = mAnimations.find(direction);
- // When the direction isn't defined, try the default
+ // When the given direction is not available, return the first one.
+ // (either DEFAULT, or more usually DOWN).
if (i == mAnimations.end())
{
- i = mAnimations.find(0);
+ i = mAnimations.begin();
}
return (i == mAnimations.end()) ? NULL : i->second;
@@ -57,11 +58,5 @@ Action::getAnimation(int direction) const
void
Action::setAnimation(int direction, Animation *animation)
{
- // Set first direction as default direction
- if (mAnimations.empty())
- {
- mAnimations[0] = animation;
- }
-
mAnimations[direction] = animation;
}