it only counts the first 10 light sources
Not first. 10 light sources, sends signal to overmap. You may have 50 sources and only 7 send signal. In this case code will counts all 50.
so place 10 weak light sources on the north side of the map
10 ANY power light sources (file/player/items/vehs) on ANY side of the map will send signal to hordes because it close to side of the map.
and now you have occasional slowdown to boot.
If you not burn much houses - all ok.
Also, you forget that your way is not good, because it’s way to permadeath from horde if you found lava at night somewhere near you new base.
If you have struct like
{
int source_power;
enum source_type;
};
i may be do it. But you want horde-permadeath-from-lava. Do it. I don’t care about it.
Also you get same problem with slowdown if you have many strong light sources INSIDE building (burning house): get stronges, not visible, next, also, next … …, visible, send signal, go out. This is not a solution.
If count of light sources < 10-20 there is NO slowdowns and your method not needed for it.
So you not have really good solution for this problem, but you think, that you way better. Bravo.