diff options
Diffstat (limited to 'src/actorsprite.cpp')
-rw-r--r-- | src/actorsprite.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/actorsprite.cpp b/src/actorsprite.cpp index a7821699..1104d810 100644 --- a/src/actorsprite.cpp +++ b/src/actorsprite.cpp @@ -43,6 +43,7 @@ ImageSet *ActorSprite::targetCursorImages[2][NUM_TC]; SimpleAnimation *ActorSprite::targetCursor[2][NUM_TC]; +bool ActorSprite::loaded = false; ActorSprite::ActorSprite(int id): mId(id), @@ -345,12 +346,21 @@ void ActorSprite::setupSpriteDisplay(const SpriteDisplay &display, void ActorSprite::load() { + if (loaded) + unload(); + initTargetCursor(); + + loaded = true; } void ActorSprite::unload() { + if (!loaded) + return; + cleanupTargetCursors(); + loaded = false; } static const char *cursorType(int type) |