1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-10-27 11:57:40 +00:00

fixed through_wall

This commit is contained in:
Zeno Rogue
2022-10-27 10:33:47 +02:00
parent 18f571b683
commit 64a613572a
2 changed files with 5 additions and 5 deletions

View File

@@ -5075,11 +5075,11 @@ EX shiftmatrix cview(ld base_shift IS(0)) {
EX int point_direction; EX int point_direction;
EX int through_wall(hyperpoint at) { EX int through_wall(cell *c, hyperpoint at) {
ld dist = hdist0(at); ld dist = hdist0(at);
int nei = -1; int nei = -1;
for(int i=0; i<centerover->type; i++) { for(int i=0; i<c->type; i++) {
ld dist1 = hdist0(currentmap->ray_iadj(centerover, i) * at); ld dist1 = hdist0(currentmap->ray_iadj(c, i) * at);
if(dist1 < dist) nei = i, dist = dist1; if(dist1 < dist) nei = i, dist = dist1;
} }
return nei; return nei;
@@ -5094,7 +5094,7 @@ EX void precise_mouseover() {
cell *c = centerover; cell *c = centerover;
for(int i=0; i<100; i++) { for(int i=0; i<100; i++) {
apply_parallel_transport(T, ori, ztangent(step)); apply_parallel_transport(T, ori, ztangent(step));
int pd = through_wall(T * C0); int pd = through_wall(c, T * C0);
if(pd != -1) { if(pd != -1) {
color_t col; color_t col;
cell *c1 = c->cmove(pd); cell *c1 = c->cmove(pd);

View File

@@ -546,7 +546,7 @@ EX void shift_view_portal(hyperpoint H) {
EX const connection_data* through_portal() { EX const connection_data* through_portal() {
transmatrix iView = view_inverse(View); transmatrix iView = view_inverse(View);
int nei = through_wall(iView * C0); int nei = through_wall(centerover, iView * C0);
if(nei == -1) return nullptr; if(nei == -1) return nullptr;
auto cw1 = cellwalker(centerover, nei); auto cw1 = cellwalker(centerover, nei);
return at_or_null(connections, cw1); return at_or_null(connections, cw1);