1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-10-14 22:07:38 +00:00

intra:: optimize saved maps

This commit is contained in:
Zeno Rogue
2021-10-10 00:38:38 +02:00
parent 5d5f93e1bc
commit 6db94b134d
2 changed files with 27 additions and 0 deletions

View File

@@ -702,6 +702,7 @@ EX namespace mapstream {
}
addToQueue(save_start());
if(intra::in) intra::prepare_need_to_save();
for(int i=0; i<isize(cellbyid); i++) {
cell *c = cellbyid[i];
if(i) {
@@ -743,6 +744,9 @@ EX namespace mapstream {
// f.write_char(c->bardir);
f.write(c->wparam); f.write(c->landparam);
f.write_char(c->stuntime); f.write_char(c->hitpoints);
bool blocked = false;
if(intra::in && isWall3(c) && !intra::need_to_save.count(c)) blocked = true;
if(!blocked)
for(int j=0; j<c->type; j++) {
cell *c2 = c->move(j);
if(c2 && c2->land != laNone) addToQueue(c2);