mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-12-20 15:40:26 +00:00
fixed a bug with cleaning quotient spaces
This commit is contained in:
parent
2a59ff7ab2
commit
b693c3ca58
@ -100,7 +100,7 @@ bool grailWasFound(cell *c) {
|
||||
return c->master->alt->alt->emeraldval & GRAIL_FOUND;
|
||||
}
|
||||
|
||||
void generateAlts(heptagon *h, int levs) {
|
||||
void generateAlts(heptagon *h, int levs, bool link_cdata) {
|
||||
if(!h->alt) return;
|
||||
preventbarriers(h->c7);
|
||||
for(int i=0; i<S7; i++) preventbarriers(h->c7->mov[i]);
|
||||
@ -142,8 +142,8 @@ void generateAlts(heptagon *h, int levs) {
|
||||
continue;
|
||||
}
|
||||
ho->alt = hm;
|
||||
hm->cdata = (cdata*) ho;
|
||||
if(levs) generateAlts(ho, levs-1);
|
||||
if(link_cdata) hm->cdata = (cdata*) ho;
|
||||
if(levs) generateAlts(ho, levs-1, link_cdata);
|
||||
}
|
||||
}
|
||||
|
||||
|
23
cell.cpp
23
cell.cpp
@ -592,8 +592,8 @@ struct hrmap_quotient : hrmap {
|
||||
|
||||
vector<heptagon*> allh;
|
||||
|
||||
hrmap_quotient() {
|
||||
|
||||
hrmap_quotient() {
|
||||
|
||||
if(quotient == 2) {
|
||||
connections = currfp.connections;
|
||||
}
|
||||
@ -643,7 +643,7 @@ struct hrmap_quotient : hrmap {
|
||||
}
|
||||
|
||||
for(int i=0; i<TOT; i++) {
|
||||
generateAlts(allh[i]);
|
||||
generateAlts(allh[i], S3-3, false);
|
||||
allh[i]->emeraldval = allh[i]->alt->emeraldval;
|
||||
allh[i]->zebraval = allh[i]->alt->zebraval;
|
||||
allh[i]->fiftyval = allh[i]->alt->fiftyval;
|
||||
@ -840,19 +840,24 @@ void clearHexes(heptagon *at) {
|
||||
at->cdata = NULL;
|
||||
}
|
||||
if(at->c7) {
|
||||
if(!nonbitrunc) for(int i=0; i<S7; i++)
|
||||
if(!nonbitrunc) for(int i=0; i<S7; i++) {
|
||||
clearcell(at->c7->mov[i]);
|
||||
}
|
||||
clearcell(at->c7);
|
||||
}
|
||||
}
|
||||
|
||||
void unlink_cdata(heptagon *h) {
|
||||
if(h->alt && h->c7) {
|
||||
if(h->alt->cdata == (cdata*) h)
|
||||
h->alt->cdata = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void clearfrom(heptagon *at) {
|
||||
queue<heptagon*> q;
|
||||
unlink_cdata(at);
|
||||
q.push(at);
|
||||
if(at->alt && at->c7) {
|
||||
printf("disconnect %p -> %p (from real)\n", at, at->alt);
|
||||
at->alt->cdata = NULL;
|
||||
}
|
||||
at->alt = &deletion_marker;
|
||||
//int maxq = 0;
|
||||
while(!q.empty()) {
|
||||
@ -874,7 +879,7 @@ void clearfrom(heptagon *at) {
|
||||
for(int i=0; i<S7; i++) if(at->move[i]) {
|
||||
if(at->move[i]->alt != &deletion_marker)
|
||||
q.push(at->move[i]);
|
||||
if(at->move[i]->alt && at->move[i]->c7) at->move[i]->alt->cdata = NULL;
|
||||
unlink_cdata(at->move[i]);
|
||||
at->move[i]->alt = &deletion_marker;
|
||||
DEBMEM ( printf("!mov %p [%p]\n", at->move[i], at->move[i]->move[at->spin(i)]); )
|
||||
if(at->move[i]->move[at->spin(i)] != NULL &&
|
||||
|
2
hyper.h
2
hyper.h
@ -324,7 +324,7 @@ bool destroyHalfvine(cell *c, eWall newwall = waNone, int tval = 6);
|
||||
void buildCrossroads2(cell *c);
|
||||
bool isHaunted(eLand l);
|
||||
heptagon *createAlternateMap(cell *c, int rad, hstate firststate, int special=0);
|
||||
void generateAlts(heptagon *h, int levs = S3-3);
|
||||
void generateAlts(heptagon *h, int levs = S3-3, bool link_cdata = true);
|
||||
void setdist(cell *c, int d, cell *from);
|
||||
void checkOnYendorPath();
|
||||
void killThePlayerAt(eMonster m, cell *c, flagtype flags);
|
||||
|
Loading…
Reference in New Issue
Block a user