mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-02-22 14:00:13 +00:00
intra:: correct cleanup of intra maps
This commit is contained in:
parent
0aa338e9eb
commit
443ecf0331
6
cell.cpp
6
cell.cpp
@ -1293,6 +1293,12 @@ EX vector<cell*> build_shortest_path(cell *c1, cell *c2) {
|
||||
}
|
||||
|
||||
EX void clearCellMemory() {
|
||||
#if MAXMDIM >= 4
|
||||
if(intra::in) {
|
||||
intra::erase_all_maps();
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
for(int i=0; i<isize(allmaps); i++)
|
||||
if(allmaps[i])
|
||||
delete allmaps[i];
|
||||
|
15
intra.cpp
15
intra.cpp
@ -763,6 +763,21 @@ EX void kill(int id) {
|
||||
println(hlog, isize(to_remove), " connections and ", isize(to_erase_cell), " cells erased");
|
||||
}
|
||||
|
||||
EX void erase_all_maps() {
|
||||
println(hlog, "erase_all_maps called");
|
||||
data[current].gd.storegame();
|
||||
in = false;
|
||||
for(int i=0; i<isize(data); i++) {
|
||||
current = i;
|
||||
ginf[gProduct] = data[i].gi;
|
||||
data[i].gd.restoregame();
|
||||
clearCellMemory();
|
||||
}
|
||||
intra_id.clear();
|
||||
connections.clear();
|
||||
data.clear();
|
||||
}
|
||||
|
||||
EX set<cell*> need_to_save;
|
||||
|
||||
EX void prepare_need_to_save() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user