So I am getting a runtime error and I have narrowed down the problem to this method.
I am still learning about iterators and I assume that the problem is with this part of the code, getting the expression error
list iterator not decrementable.
Any help would be appreciated.
void Level::update()
{
for (Iter = npc.begin(); Iter != npc.end(); Iter++)
{
//dereferance *Iter to use pointer notation
(*Iter)->idleUpdate();
if ((*Iter)->isAlive() == false)
{
sprite *temp = *Iter;
Iter--;
delete temp;
npc.remove(temp);
}
}
}