From b55eb5721efc684f414c79d673bec7d8cf6a9f34 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Sun, 21 Mar 2021 10:42:36 +0100 Subject: [PATCH] you can no longer go through walls in portalspaces --- cell.cpp | 5 +++++ hypgraph.cpp | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/cell.cpp b/cell.cpp index 3e2448ec..a1da6f8c 100644 --- a/cell.cpp +++ b/cell.cpp @@ -1371,4 +1371,9 @@ EX int valence() { return S3; } +/** portalspaces are not defined outside of a boundary */ +EX bool is_boundary(cell *c) { + return (cgflags & qPORTALSPACE) && isWall(c->wall); + } + } diff --git a/hypgraph.cpp b/hypgraph.cpp index 2dafd989..b7978dc2 100644 --- a/hypgraph.cpp +++ b/hypgraph.cpp @@ -1955,6 +1955,8 @@ EX void centerpc(ld aspd) { ors::rerotate(W); ors::rerotate(cwtV.T); ors::rerotate(View); } +EX transmatrix oView; + EX void optimizeview() { if(subscreens::split(optimizeview)) return; @@ -1971,6 +1973,11 @@ EX void optimizeview() { View = iview_inverse(iView); fixmatrix(View); + + if(is_boundary(centerover)) + centerover = c, View = oView; + else + oView = View; #if CAP_ANIMATIONS if(centerover && inmirror(centerover)) {