[Software] Use the light at the bottom of the object for splats

This commit is contained in:
Jaime Passos 2020-10-13 23:12:44 -03:00
parent 4b7bfce95e
commit a8a66f698a
1 changed files with 2 additions and 1 deletions

View File

@ -1914,12 +1914,13 @@ static void R_ProjectSprite(mobj_t *thing)
if (thing->subsector->sector->numlights)
{
INT32 lightnum;
fixed_t top = (splat) ? gz : gzt;
light = thing->subsector->sector->numlights - 1;
// R_GetPlaneLight won't work on sloped lights!
for (lightnum = 1; lightnum < thing->subsector->sector->numlights; lightnum++) {
fixed_t h = P_GetLightZAt(&thing->subsector->sector->lightlist[lightnum], thing->x, thing->y);
if (h <= gzt) {
if (h <= top) {
light = lightnum - 1;
break;
}