- fixed: IsVisibleToPlayer needs to be checked for the owner of owned dynamic lights.

This commit is contained in:
Christoph Oelckers 2013-11-30 13:15:22 +01:00
parent 992994239b
commit 9ac3b6aa1b
2 changed files with 36 additions and 29 deletions

View File

@ -183,6 +183,10 @@ bool gl_SetupLight(Plane & p, ADynamicLight * light, Vector & nearPt, Vector & u
{ {
return false; return false;
} }
if (light->owned && light->target != NULL && !light->target->IsVisibleToPlayer())
{
return false;
}
scale = 1.0f / ((2.f * radius) - dist); scale = 1.0f / ((2.f * radius) - dist);

View File

@ -79,6 +79,8 @@ bool gl_GetSpriteLight(AActor *self, fixed_t x, fixed_t y, fixed_t z, subsector_
while (node) while (node)
{ {
light=node->lightsource; light=node->lightsource;
if (!light->owned || light->target == NULL || light->target->IsVisibleToPlayer())
{
if (!(light->flags2&MF2_DORMANT) && if (!(light->flags2&MF2_DORMANT) &&
(!(light->flags4&MF4_DONTLIGHTSELF) || light->target != self)) (!(light->flags4&MF4_DONTLIGHTSELF) || light->target != self))
{ {
@ -118,6 +120,7 @@ bool gl_GetSpriteLight(AActor *self, fixed_t x, fixed_t y, fixed_t z, subsector_
} }
} }
} }
}
node = node->nextLight; node = node->nextLight;
} }
} }