fixed a bug in fixStorage

This commit is contained in:
Zeno Rogue 2018-05-22 20:40:52 +02:00
parent fc964ec7b2
commit e5d5678900
1 changed files with 7 additions and 5 deletions

View File

@ -2861,12 +2861,14 @@ void activateMonstersAt(cell *c) {
}
void fixStorage() {
vector<monster*> restore;
for(auto it = monstersAt.begin(); it != monstersAt.end(); it++)
if(it->second->base != it->first) {
restore.push_back(it->second);
monstersAt.erase(it++);
}
for(auto it = monstersAt.begin(); it != monstersAt.end(); it++)
restore.push_back(it->second);
monstersAt.clear();
for(monster *m: restore) m->store();
}