1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-09-02 10:48:04 +00:00

map editor:: building mode

This commit is contained in:
Zeno Rogue
2022-10-27 09:45:03 +02:00
parent 87921fe0f9
commit 6ef282173f
3 changed files with 53 additions and 8 deletions

View File

@@ -546,13 +546,8 @@ EX void shift_view_portal(hyperpoint H) {
EX const connection_data* through_portal() {
transmatrix iView = view_inverse(View);
ld dist = hdist0(iView * C0);
int nei = -1;
for(int i=0; i<centerover->type; i++) {
ld dist1 = hdist0(currentmap->ray_iadj(centerover, i) * iView * C0);
if(dist1 < dist) nei = i, dist = dist1;
}
int nei = through_wall(iView * C0);
if(nei == -1) return nullptr;
auto cw1 = cellwalker(centerover, nei);
return at_or_null(connections, cw1);
}