1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-12-30 03:50:34 +00:00

arb:: fixed get_corner_position to work with negative cid

This commit is contained in:
Zeno Rogue 2019-12-23 20:51:36 +01:00
parent 7a0e8ec022
commit 97ea8f8c4b

View File

@ -426,7 +426,7 @@ EX hyperpoint get_corner_position(cell *c, int cid, ld cf IS(3)) {
#endif #endif
if(arb::in()) { if(arb::in()) {
auto& sh = arb::current.shapes[arb::id_of(c->master)]; auto& sh = arb::current.shapes[arb::id_of(c->master)];
return normalize(C0 + (sh.vertices[cid % c->type] - C0) * 3 / cf); return normalize(C0 + (sh.vertices[gmod(cid, c->type)] - C0) * 3 / cf);
} }
if(PURE) { if(PURE) {
return ddspin(c,cid,M_PI/S7) * xpush0(cgi.hcrossf * 3 / cf); return ddspin(c,cid,M_PI/S7) * xpush0(cgi.hcrossf * 3 / cf);