1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-12-18 23:10:26 +00:00

3d:: vision-based gamerange in shmup

This commit is contained in:
Zeno Rogue 2019-03-09 18:31:02 +01:00
parent 4a151f9c63
commit f0092d9633

View File

@ -3105,13 +3105,16 @@ void bfs() {
} }
int qb = 0; int qb = 0;
first7 = 0;
while(true) { while(true) {
if(qb == isize(dcal)) break; if(qb == isize(dcal)) break;
int i, fd = reachedfrom[qb] + 3; int i, fd = reachedfrom[qb] + 3;
cell *c = dcal[qb++]; cell *c = dcal[qb++];
int d = c->cpdist; int d = c->cpdist;
if(d == distlimit) { first7 = qb; break; }
if(DIM == 2 && d == distlimit) { first7 = qb; break; }
for(int j=0; j<c->type; j++) if(i = (fd+j) % c->type, c->move(i)) { for(int j=0; j<c->type; j++) if(i = (fd+j) % c->type, c->move(i)) {
// printf("i=%d cd=%d\n", i, c->move(i)->cpdist); // printf("i=%d cd=%d\n", i, c->move(i)->cpdist);
cell *c2 = c->move(i); cell *c2 = c->move(i);
@ -3125,6 +3128,10 @@ void bfs() {
c2->wall = waSea; c2->wall = waSea;
if(c2 && signed(c2->cpdist) > d+1) { if(c2 && signed(c2->cpdist) > d+1) {
if(DIM == 3 && !gmatrix.count(c2)) {
if(!first7) first7 = qb;
continue;
}
c2->cpdist = d+1; c2->cpdist = d+1;
// remove treasures // remove treasures