- Fixed: dynamic lights ticked even when disabled.

This commit is contained in:
drfrag 2020-12-25 18:12:17 +01:00
parent 846de93f3a
commit 53db54713c

View file

@ -53,6 +53,9 @@ extern cycle_t BotSupportCycles;
extern cycle_t ActionCycles;
extern int BotWTG;
EXTERN_CVAR (Bool, gl_lights)
EXTERN_CVAR (Bool, r_dynlights)
IMPLEMENT_CLASS(DThinker, false, false)
DThinker *NextToThink;
@ -624,11 +627,14 @@ void DThinker::RunThinkers ()
}
} while (count != 0);
for (auto light = level.lights; light;)
if (level.lights && (gl_lights || r_dynlights))
{
auto next = light->next;
light->Tick();
light = next;
for (auto light = level.lights; light;)
{
auto next = light->next;
light->Tick();
light = next;
}
}
}
else
@ -650,7 +656,7 @@ void DThinker::RunThinkers ()
}
} while (count != 0);
if (level.lights)
if (level.lights && (gl_lights || r_dynlights))
{
// Also profile the internal dynamic lights, even though they are not implemented as thinkers.
auto &prof = Profiles[NAME_InternalDynamicLight];