Add additional null pointer checks for spot lights

This commit is contained in:
dpjudas 2024-05-12 02:55:44 +02:00
commit 92230626c1

View file

@ -231,7 +231,7 @@ int DoomLevelMesh::GetLightIndex(FDynamicLight* light, int portalgroup)
meshlight.RelativeOrigin = meshlight.Origin;
meshlight.Radius = (float)light->GetRadius();
meshlight.Intensity = light->target ? (float)light->target->Alpha : 1.0f;
if (light->IsSpot())
if (light->IsSpot() && light->pSpotInnerAngle && light->pSpotOuterAngle && light->pPitch && light->target)
{
meshlight.InnerAngleCos = (float)light->pSpotInnerAngle->Cos();
meshlight.OuterAngleCos = (float)light->pSpotOuterAngle->Cos();