diff --git a/src/p_3dfloors.cpp b/src/p_3dfloors.cpp index e294dec692..37ecaed271 100644 --- a/src/p_3dfloors.cpp +++ b/src/p_3dfloors.cpp @@ -290,6 +290,7 @@ static int P_Set3DFloor(line_t * line, int param, int param2, int alpha) // if flooding is used the floor must be non-solid and is automatically made shootthrough and seethrough if ((param2&128) && !(flags & FF_SOLID)) flags |= FF_FLOOD|FF_SEETHROUGH|FF_SHOOTTHROUGH; if (param2&512) flags |= FF_FADEWALLS; + if (param2&1024) flags |= FF_RESET; FTextureID tex = line->sidedef[0]->GetTexture(side_t::top); if (!tex.Exists() && alpha<255) { @@ -434,6 +435,7 @@ void P_Recalculate3DFloors(sector_t * sector) fixed_t maxheight, minheight; unsigned i, j; lightlist_t newlight; + lightlist_t resetlight; // what it goes back to after FF_DOUBLESHADOW TArray & ffloors=sector->e->XFloor.ffloors; TArray & lightlist = sector->e->XFloor.lightlist; @@ -588,7 +590,9 @@ void P_Recalculate3DFloors(sector_t * sector) lightlist[0].extra_colormap = sector->ColorMap; lightlist[0].blend = 0; lightlist[0].flags = 0; - + + resetlight = lightlist[0]; + maxheight = sector->CenterCeiling(); minheight = sector->CenterFloor(); for(i = 0; i < ffloors.Size(); i++) @@ -611,7 +615,7 @@ void P_Recalculate3DFloors(sector_t * sector) newlight.flags = rover->flags; lightlist.Push(newlight); } - else if (i==0) + else //if (i==0) { fixed_t ff_bottom=rover->bottom.plane->ZatPoint(CenterSpot(sector)); if (ff_bottomflags; } } + if (!(rover->flags & (FF_DOUBLESHADOW | FF_RESET))) + { + resetlight = lightlist.Last(); + } + else if (rover->flags & FF_RESET) + { + resetlight.p_lightlevel = §or->lightlevel; + resetlight.lightsource = NULL; + resetlight.extra_colormap = sector->ColorMap; + resetlight.blend = 0; + } + if (rover->flags&FF_DOUBLESHADOW) { fixed_t ff_bottom=rover->bottom.plane->ZatPoint(CenterSpot(sector)); @@ -632,20 +648,10 @@ void P_Recalculate3DFloors(sector_t * sector) { newlight.caster = rover; newlight.plane = *rover->bottom.plane; - if (lightlist.Size()>1) - { - newlight.lightsource = lightlist[lightlist.Size()-2].lightsource; - newlight.p_lightlevel = lightlist[lightlist.Size()-2].p_lightlevel; - newlight.extra_colormap = lightlist[lightlist.Size()-2].extra_colormap; - newlight.blend = lightlist[lightlist.Size()-2].blend; - } - else - { - newlight.lightsource = NULL; - newlight.p_lightlevel = §or->lightlevel; - newlight.extra_colormap = sector->ColorMap; - newlight.blend = 0; - } + newlight.lightsource = resetlight.lightsource; + newlight.p_lightlevel = resetlight.p_lightlevel; + newlight.extra_colormap = resetlight.extra_colormap; + newlight.blend = resetlight.blend; newlight.flags = rover->flags; lightlist.Push(newlight); } @@ -825,7 +831,7 @@ void P_LineOpening_XFloors (FLineOpening &open, AActor * thing, const line_t *li //========================================================================== void P_Spawn3DFloors (void) { - static int flagvals[] = {128+512, 2+512, 512}; + static int flagvals[] = {512, 2+512, 512+1024}; int i; line_t * line; diff --git a/src/p_3dfloors.h b/src/p_3dfloors.h index 0dfdf872c2..5ddded3d3c 100644 --- a/src/p_3dfloors.h +++ b/src/p_3dfloors.h @@ -35,6 +35,7 @@ typedef enum FF_ADDITIVETRANS = 0x10000000, // Render this floor with additive translucency FF_FLOOD = 0x20000000, // extends towards the next lowest flooding or solid 3D floor or the bottom of the sector FF_THISINSIDE = 0x40000000, // hack for software 3D with FF_BOTHPLANES + FF_RESET = 0x80000000, // light effect is completely reset, once interrupted } ffloortype_e; // This is for the purpose of Sector_SetContents: