From 23c9f2c31d40cfd23e00f2021505071d900b9756 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Wed, 5 Aug 2026 14:33:15 +0200 Subject: [PATCH] los:: shmup:: takes sub-cell position into account; actually works against monsters --- environment.cpp | 12 +++++++----- shmup.cpp | 1 + 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/environment.cpp b/environment.cpp index 8bec8140..3abfff9d 100644 --- a/environment.cpp +++ b/environment.cpp @@ -994,13 +994,15 @@ EX void create_los() { current_fov[c] |= blocks_sight(c, c1) ? 1 : 3; } } - if(lineofsight == los::geometric) { + if(lineofsight == los::geometric) for(int p=0; prelative_matrix(c, cp, C0)); + for(auto c: dcal) { + transmatrix R = currentmap->relative_matrix(c, cp, C0); + hyperpoint h = tC0(R); transmatrix T = spintox(h); + if(shmup::on) T = iso_inverse(shmup::pc[p]->at) * T; cellwalker at = cp; while(true) { diff --git a/shmup.cpp b/shmup.cpp index b5b13b89..b4dcbf75 100644 --- a/shmup.cpp +++ b/shmup.cpp @@ -2728,6 +2728,7 @@ EX void turn(int delta) { if(d == PINFD-1) continue; for(int i=0; itype; i++) { cell *c2 = c->move(i); + if(!in_line_of_sight(c2)) continue; // printf("i=%d cd=%d\n", i, c->move(i)->cpdist); if(c2 && c2->pathdist == PINFD && gmatrix.count(c2) && (passable_for(eMonster(t), c, c2, P_CHAIN | P_ONPLAYER) || c->wall == waThumperOn)) {