diff --git a/include/jGL/spriteRenderer.h b/include/jGL/spriteRenderer.h index c7b37e6..380bd1a 100644 --- a/include/jGL/spriteRenderer.h +++ b/include/jGL/spriteRenderer.h @@ -118,12 +118,13 @@ namespace jGL { if (sprites.find(id) == sprites.end()){ return; } - for (auto & e : ids) + std::multimap::iterator iter; + for (iter = ids.begin(); iter != ids.end(); iter++) { - if (e.second == id) + if (iter->second == id) { - ids.erase(e.first); - ids.insert(std::pair(newPriority, e.second)); + ids.erase(iter); + ids.insert(std::pair(newPriority, id)); break; } }