Erase rosemap entries for deleted cells

This commit is contained in:
Jesse Ruderman 2021-08-22 02:00:04 -07:00
parent 5f1f10c79f
commit 34537282f8
1 changed files with 3 additions and 0 deletions

View File

@ -1706,5 +1706,8 @@ addHook(hooks_removecells, 0, [] () {
eliminate_if(butterflies, [] (pair<cell*,int>& p) { return is_cell_removed(p.first); });
for(int i=0; i<SHSIZE; i++) for(int p=0; p<MAXPLAYER; p++)
set_if_removed(shpos[i][p], NULL);
vector<cell*> to_remove;
for(auto p: rosemap) if(is_cell_removed(p.first)) to_remove.push_back(p.first);
for(auto r: to_remove) rosemap.erase(r);
});
}