From e742b42ef99fa29a4ad2d65f6c69feabd28482cb Mon Sep 17 00:00:00 2001 From: terminx Date: Fri, 23 Oct 2015 23:00:13 +0000 Subject: [PATCH] Disable Polymer lights attached to hidden switches. git-svn-id: https://svn.eduke32.com/eduke32@5404 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/source/actors.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/polymer/eduke32/source/actors.c b/polymer/eduke32/source/actors.c index 6c34c8331..96f135594 100644 --- a/polymer/eduke32/source/actors.c +++ b/polymer/eduke32/source/actors.c @@ -7985,12 +7985,22 @@ static void A_DoLight(int32_t i) s->x += dx>>7; s->y += dy>>7; + int16_t sectnum = s->sectnum; + updatesector(s->x, s->y, §num); + + if ((unsigned) sectnum >= MAXSECTORS || s->z > sector[sectnum].floorz) + { + s->x -= dx>>7; + s->y -= dy>>7; + break; + } + G_AddGameLight(0, i, ((s->yrepeat*tilesiz[s->picnum].y)<<1), 1024-ii*256, ii==0 ? (48+(255<<8)+(48<<16)) : 255+(48<<8)+(48<<16), PR_LIGHT_PRIO_LOW); s->x -= dx>>7; s->y -= dy>>7; - } + } break; } }