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

fieldval_uniq for euc::in(3)

This commit is contained in:
Zeno Rogue 2020-06-16 01:17:28 +02:00
parent f00ce7f857
commit 2da94c3986

View File

@ -389,11 +389,17 @@ EX int fieldval_uniq(cell *c) {
if(ctof(c)) return c->master->fieldval;
else return createMov(c, 0)->master->fieldval + 256 * createMov(c,2)->master->fieldval + (1<<16) * createMov(c,4)->master->fieldval;
}
else if(euc::in()) {
else if(euc::in(2)) {
auto p = euc2_coordinates(c);
if(bounded) return p.first + (p.second << 16);
return gmod(p.first - 22 * p.second, 3*127);
}
else if(euc::in(3)) {
auto co = euc::get_ispacemap()[c->master];
println(hlog, "co = ", co);
if(bounded) return co[0] + (co[1] << 10) + (co[2] << 20);
return gmod(co[0] + 3 * co[1] + 9 * co[2], 3*127);
}
else if(bt::in() || arcm::in() || nil || S3 >= OINF || (cgflags & qIDEAL)) return 0;
else if(&currfp == &fp_invalid) return 0;
else if(geometry == gSpace535) return 0;