From a43f31e46ce33641563deb5616ec5affd516c09a Mon Sep 17 00:00:00 2001 From: helixhorned Date: Sun, 2 Aug 2009 20:20:26 +0000 Subject: [PATCH] m32: "ported" searchwall determination when aiming at floor or ceiling to polymost git-svn-id: https://svn.eduke32.com/eduke32@1484 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/src/polymost.c | 40 ++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/polymer/eduke32/build/src/polymost.c b/polymer/eduke32/build/src/polymost.c index ce9460ca5..539db94c2 100644 --- a/polymer/eduke32/build/src/polymost.c +++ b/polymer/eduke32/build/src/polymost.c @@ -4263,6 +4263,46 @@ void polymost_drawrooms() if ((hitinfo.pos.z<<1) < cz+fz) searchstat = 1; else searchstat = 2; //if (vz < 0) searchstat = 1; else searchstat = 2; //Won't work for slopes :/ } + + if ((searchstat==1 || searchstat==2) && searchsector>=0) + { + int32_t scrv[2] = {(vx>>12), (vy>>12)}; + int32_t scrv_r[2] = {scrv[1], -scrv[0]}; + walltype *wal = &wall[sector[searchsector].wallptr]; + int32_t wdistsq, bestwdistsq=0x7fffffff; + int16_t k, bestk=-1; + + for (k=0; k= 0) + searchwall = sector[searchsector].wallptr + bestk; + } searchit = 0; }