diff options
-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | src/being.cpp | 12 |
2 files changed, 5 insertions, 8 deletions
@@ -1,5 +1,6 @@ 2006-08-04 Björn Steinbrink <B.Steinbrink@gmx + * src/animatedsprite.cpp: Fix enum being treated as string. * src/animation.cpp: Small code cleanups. Removed unused headers. * src/animatedsprite.cpp: Small code cleanup/lower indentation. diff --git a/src/being.cpp b/src/being.cpp index 4d106641..a688aec5 100644 --- a/src/being.cpp +++ b/src/being.cpp @@ -22,6 +22,8 @@ */ #include "being.h" +#include <algorithm> + #include "animatedsprite.h" #include "equipment.h" #include "game.h" @@ -33,6 +35,7 @@ #include "gui/gui.h" +#include "utils/dtor.h" #include "utils/tostring.h" extern Spriteset *emotionset; @@ -66,14 +69,7 @@ Being::Being(Uint32 id, Uint16 job, Map *map): Being::~Being() { - for (int i = 0; i < VECTOREND_SPRITE; i++) - { - if (mSprites[i] != NULL) - { - delete mSprites[i]; - } - } - + std::for_each(mSprites.begin(), mSprites.end(), make_dtor(mSprites)); clearPath(); setMap(NULL); } |