diff --git a/src/otclient/core/effect.cpp b/src/otclient/core/effect.cpp index 4ae5b4e5..18338e0d 100644 --- a/src/otclient/core/effect.cpp +++ b/src/otclient/core/effect.cpp @@ -16,11 +16,13 @@ void Effect::draw(int x, int y) if(!m_finished) { if(g_platform.getTicks() - m_lastTicks > 75) { const ThingAttributes& attributes = getAttributes(); - m_animation++; - if(m_animation == attributes.animcount) { + + if(m_animation+1 == attributes.animcount) { g_dispatcher.addEvent(std::bind(&Map::removeThing, &g_map, asThing())); m_finished = true; } + else + m_animation++; m_lastTicks = g_platform.getTicks(); } diff --git a/src/otclient/core/spritemanager.cpp b/src/otclient/core/spritemanager.cpp index 5b5b8aec..2b2085c3 100644 --- a/src/otclient/core/spritemanager.cpp +++ b/src/otclient/core/spritemanager.cpp @@ -93,7 +93,7 @@ TexturePtr SpriteManager::getSpriteTexture(int id) if(id == 0) return g_graphics.getEmptyTexture(); - assert(id <= m_spritesCount); + assert(id > 0 && id <= m_spritesCount); // load sprites on demand TexturePtr texture = m_sprites[id-1];