1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-11-27 22:39:53 +00:00

Merge pull request #296 from jruderman/rose_crash

Erase rosemap entries for deleted cells
This commit is contained in:
Zeno Rogue 2021-08-22 23:35:18 +02:00 committed by GitHub
commit c6aa583a3d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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);
});
}