Thanks for sharing this!
I checked that in both instances you have two or more light sprites in the same sector.
SE12, SE3 SE4 are all applied in code with the exact same logic.
This is the same root cause which ck3d had.
What happens is that the preview quickly modifies the map JUST before it draws the 3D elements and restores the state RIGHT after.
The saving is sort of:
-> ONE BY ONE do this (by running through all map sprites with SE texture)
- Check if it's 12, 3 or 4 lotag (A light preview needed)
- If so, let's do preview for this sector!
----> Save floor/ceiling/wall/sprite pals and shade to a dedicated slot for this sector and it's walls (One slot for each Sector ID and Wall ID)
----> Set all of the sector's floor/wall/ceiling/sprites to whatever the SE sprite is shaded/pal'd as
DONE! Check if we have more SE sprites in the map that need to be checked for preview
<< DRAW THE FRAME >>
- Restore floor/ceiling/wall/sprite pals/shade which was saved
DONE!
The problem here are these "dedicated slots" which only account for ONE run of this logic.
So if you check the SE sprites again and find another light sprite in the same sector, it will just blindly save the current preview state over the saved shade/pals we had and re-applies it's contents there.
The reason why you don't get double shading is that the sprite was just changed to a matching shade/pal of the first light SE.
But this means that the original data was just lost!
I've made a MR with this fixed in:
https://voidpoint.io...ge_requests/348
In this one it will mark if a sector has already been previewed once for this draw loop, skipping subsequent applications of SE.
For the time being you can use this temporary build of mapster32 which has this commit built in:
https://lerppu.net/e...2/mapster32.exe