1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-10-23 09:57:41 +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

@@ -2972,6 +2972,7 @@ void turn(int delta) {
if(havewhat&HF_RIVER) prairie::move();
}
if(recallCell && !markOrb(itOrbRecall)) activateRecall();
save_memory();
}
if(elec::havecharge) elec::act();
popmonsters();
@@ -3468,6 +3469,16 @@ void addShmupHelp(string& out) {
}
}
auto hooks = addHook(clearmemory, 0, shmup::clearMemory);
auto hooks = addHook(clearmemory, 0, shmup::clearMemory) +
addHook(hooks_removecells, 0, [] () {
for(mit it = monstersAt.begin(); it != monstersAt.end();) {
if(is_cell_removed(it->first)) {
monstersAt.insert(make_pair(nullptr, it->second));
auto it0 = it; it++;
monstersAt.erase(it0);
}
else it++;
}
});
}