This is a level loading speedup, helpful mainly for levels with a lot of lightmaps. telefragged.bsp has 182 lightmaps and was spending over 3 seconds in AllocBlock while loading the level. With this patch that goes down to around 40ms, but the cost is we use 10 extra lightmaps because the packing is a bit worse.
The idea is, AllocBlock is trying to find a lightmap to fit a given surface in. Since it always starts searching at lightmap 0, once the first few lightmaps are full it's wasteful to keep trying the full lightmaps. So with the patch, as soon as a surface doesn't fit in a given lightmap, we go on to the next lightmap and never try adding surfaces to earlier lightmaps.
I tried various levels and the increase in # of lightmaps was never very high, e.g.
zendar 55 -> 57, ne_ruins start 103->104.
This was applied @ r956. Closing.