mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-28 15:02:01 +00:00
- fixed validcount for real and added a side check for intra-section sides to light code.
This commit is contained in:
parent
df52a71475
commit
aee47d23bd
1 changed files with 7 additions and 3 deletions
|
@ -578,7 +578,7 @@ void ADynamicLight::CollectWithinRadius(const DVector3 &opos, FSection *section,
|
|||
touching_sector = AddLightNode(§ion->lighthead, section, this, touching_sector);
|
||||
|
||||
|
||||
auto processSide = [&](side_t *sidedef, vertex_t *v1, vertex_t *v2)
|
||||
auto processSide = [&](side_t *sidedef, const vertex_t *v1, const vertex_t *v2)
|
||||
{
|
||||
auto linedef = sidedef->linedef;
|
||||
if (linedef && linedef->validcount != ::validcount)
|
||||
|
@ -640,7 +640,11 @@ void ADynamicLight::CollectWithinRadius(const DVector3 &opos, FSection *section,
|
|||
}
|
||||
for (auto side : section->sides)
|
||||
{
|
||||
processSide(side, side->V1(), side->V2());
|
||||
auto v1 = side->V1(), v2 = side->V2();
|
||||
if (DistToSeg(pos, v1, v2) <= radius)
|
||||
{
|
||||
processSide(side, v1, v2);
|
||||
}
|
||||
}
|
||||
sector_t *sec = section->sector;
|
||||
if (!sec->PortalBlocksSight(sector_t::ceiling))
|
||||
|
@ -707,7 +711,7 @@ void ADynamicLight::LinkLight()
|
|||
FSection *sect = R_PointInSubsector(Pos())->section;
|
||||
|
||||
dl_validcount++;
|
||||
validcount++;
|
||||
::validcount++;
|
||||
CollectWithinRadius(Pos(), sect, float(radius*radius));
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue