Only create lights for the actual static light things

This commit is contained in:
nashmuhandes 2022-02-15 22:10:32 +08:00
parent c5d09682a0
commit 15b31f0526

View file

@ -289,6 +289,10 @@ void FLevel::CreateLights()
{ {
IntThing *thing = &Things[i]; IntThing *thing = &Things[i];
// skip things that aren't actually static point lights or static spotlights
if (thing->type != 9876 && thing->type != 9881)
continue;
uint32_t lightcolor = 0xffffff; uint32_t lightcolor = 0xffffff;
float lightintensity = 1.0f; float lightintensity = 1.0f;
float lightdistance = 0.0f; float lightdistance = 0.0f;
@ -310,11 +314,11 @@ void FLevel::CreateLights()
{ {
lightdistance = atof(key.value); lightdistance = atof(key.value);
} }
else if (!stricmp(key.key, "lightinnerangle")) else if (!stricmp(key.key, "lightinnerangle") && thing->type == 9881)
{ {
innerAngleCos = std::cos(atof(key.value) * 3.14159265359f / 180.0f); innerAngleCos = std::cos(atof(key.value) * 3.14159265359f / 180.0f);
} }
else if (!stricmp(key.key, "lightouterangle")) else if (!stricmp(key.key, "lightouterangle") && thing->type == 9881)
{ {
outerAngleCos = std::cos(atof(key.value) * 3.14159265359f / 180.0f); outerAngleCos = std::cos(atof(key.value) * 3.14159265359f / 180.0f);
} }