From f8c1d5d52050c8879ce171bdd7bf681016db287a Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Sat, 3 Nov 2012 02:50:33 +0000 Subject: [PATCH] - Fixed: Masked mid textures should get their light level from the frontsector they reference, not from the sector they appear in. SVN r3935 (trunk) --- src/r_segs.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/r_segs.cpp b/src/r_segs.cpp index bfeab506ae..8c22b3e53d 100644 --- a/src/r_segs.cpp +++ b/src/r_segs.cpp @@ -2427,7 +2427,20 @@ void R_StoreWallRange (int start, int stop) } ds_p->light = rw_light; ds_p->lightstep = rw_lightstep; - ds_p->shade = wallshade; + + // Masked midtextures should get the light level from the sector they reference, + // not from the current subsector, which is what the current wallshade value + // comes from. We make an exeption for polyobjects, however, since their "home" + // sector should be whichever one they move into. + if (curline->sidedef->Flags & WALLF_POLYOBJ) + { + ds_p->shade = wallshade; + } + else + { + ds_p->shade = LIGHT2SHADE(curline->sidedef->GetLightLevel(foggy, curline->frontsector->lightlevel) + + r_actualextralight); + } if (ds_p->bFogBoundary || ds_p->maskedtexturecol != -1) {