1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-11-23 21:07:17 +00:00

fixed virtualRebase for Nil

This commit is contained in:
Zeno Rogue 2020-05-01 11:32:12 +02:00
parent fcad5d3f34
commit f355006b2b

View File

@ -287,6 +287,23 @@ void virtualRebase_cell(cell*& base, T& at, const U& check) {
template<class T, class U>
void virtualRebase(cell*& base, T& at, const U& check) {
if(nil) {
hyperpoint h = check(at);
auto step = [&] (int i) {
at = currentmap->iadj(base, i) * at;
base = base->cmove(i);
h = check(at);
};
while(h[1] < -0.5) step(1);
while(h[1] >= 0.5) step(4);
while(h[0] < -0.5) step(0);
while(h[0] >= 0.5) step(3);
while(h[2] < -0.5) step(2);
while(h[2] >= 0.5) step(5);
return;
}
if(prod) {
auto d = product_decompose(check(at)).first;
while(d > cgi.plevel / 2) {