1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-11-27 14:37:16 +00:00

fixed the mirror glitches

This commit is contained in:
Zeno Rogue 2017-09-17 12:32:31 +02:00
parent 546c1f4ef0
commit 65fb018ff8

View File

@ -1281,8 +1281,7 @@ namespace mirror {
int depth(cell *c) { return c->landparam & 255; } int depth(cell *c) { return c->landparam & 255; }
cellwalker reflect0(cell *c) { cellwalker reflect0(cellwalker cw) {
cellwalker cw(c, 0, false);
int stepcount = 0; int stepcount = 0;
cellwalker cwcopy = cw; cellwalker cwcopy = cw;
static vector<int> v; static vector<int> v;
@ -1383,7 +1382,11 @@ namespace mirror {
cw.c->landparam &= ~ (CACHEMASK << 8); cw.c->landparam &= ~ (CACHEMASK << 8);
cw.c->landparam |= (cid << 8); cw.c->landparam |= (cid << 8);
cache[cid].first = cw.c; cache[cid].first = cw.c;
cache[cid].second = reflect0(cw.c); cellwalker cw0(cw.c, 0, false);
cache[cid].second = reflect0(cw0);
int tries = 64;
while(inmirror(cache[cid].second.c) && tries--)
cache[cid].second = reflect0(cache[cid].second);
} }
cellwalker res = cache[cid].second; cellwalker res = cache[cid].second;
cwspin(res, cw.spin); cwspin(res, cw.spin);