mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-10 23:01:59 +00:00
- fixed: ACS's GetActorLightLevel didn't check 3D floors.
This commit is contained in:
parent
ba7260c176
commit
27cc3d6289
2 changed files with 21 additions and 2 deletions
|
@ -723,7 +723,7 @@ lightlist_t * P_GetPlaneLight(sector_t * sector, secplane_t * plane, bool unders
|
|||
TArray<lightlist_t> &lightlist = sector->e->XFloor.lightlist;
|
||||
|
||||
double planeheight=plane->ZatPoint(sector->centerspot);
|
||||
if(underside) planeheight--;
|
||||
if(underside) planeheight-= EQUAL_EPSILON;
|
||||
|
||||
for(i = 1; i < lightlist.Size(); i++)
|
||||
if (lightlist[i].plane.ZatPoint(sector->centerspot) <= planeheight)
|
||||
|
|
|
@ -9346,7 +9346,26 @@ scriptwait:
|
|||
AActor *actor = SingleActorFromTID(STACK(1), activator);
|
||||
if (actor != NULL)
|
||||
{
|
||||
STACK(1) = actor->Sector->lightlevel;
|
||||
sector_t *sector = actor->Sector;
|
||||
if (sector->e->XFloor.lightlist.Size())
|
||||
{
|
||||
unsigned i;
|
||||
TArray<lightlist_t> &lightlist = sector->e->XFloor.lightlist;
|
||||
|
||||
STACK(1) = *lightlist.Last().p_lightlevel;
|
||||
for (i = 1; i < lightlist.Size(); i++)
|
||||
{
|
||||
if (lightlist[i].plane.ZatPoint(actor) <= actor->Z())
|
||||
{
|
||||
STACK(1) = *lightlist[i - 1].p_lightlevel;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
STACK(1) = actor->Sector->lightlevel;
|
||||
}
|
||||
}
|
||||
else STACK(1) = 0;
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue