1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-11-13 12:17:10 +00:00

some work on the savemem feature

This commit is contained in:
Zeno Rogue
2018-01-26 01:45:49 +01:00
parent 2f9e5186f6
commit 22d3d2590f
8 changed files with 84 additions and 6 deletions

View File

@@ -3025,7 +3025,28 @@ auto ccm = addHook(clearmemory, 0, [] () {
prairie::tchoices.clear();
prairie::beaststogen.clear();
mirror::clearcache();
});
}) +
addHook(hooks_removecells, 0, [] () {
eliminate_if(heat::offscreen_heat, is_cell_removed);
eliminate_if(heat::offscreen_fire, is_cell_removed);
eliminate_if(princess::infos, [] (princess::info*& i) {
if(is_cell_removed(i->princess) || is_cell_removed(i->prison)) {
DEBSM(printf("removing a princess\n");)
if(i->princess && !is_cell_removed(i->princess)) {
DEBSM(printf("faking a princess\n");)
princess::newFakeInfo(i->princess);
}
delete i;
return true;
}
return false;
});
set_if_removed(prairie::lasttreasure, NULL);
set_if_removed(prairie::enter, NULL);
eliminate_if(prairie::tchoices, is_cell_removed);
eliminate_if(prairie::beaststogen, is_cell_removed);
for(auto& bpd: clearing::bpdata) set_if_removed(bpd.second.root, NULL);
});
// windcode arrays precomputed for speed