unsigned int expand :1; // true if lava / microbe is expanding to this tile
It's been so long I'm not sure anymore. I know there is some sharing of code between blight expansion and lava expansionFrom what I remember, you said that both things use the same code to calculate the next tile to grow
It could be that lava expands faster, in that the bit is both set and cleared between two ticks.That would be even better, since dealing with blight expansion and lava expansion at the same time can lead to serious mistakes.
I just took a quick look at the code, and I think I know what happened.I know the expand bit also seems to be used as a speed optimization in a part of the drawing code. It'll only do the calculations for drawing the Blight overlay on a tile if the expand bit is set, but the actual calculations use the microbe bit.
There appears to be some sort of class hierarchy, where both Blight and Lava derive from the same parent class. The parent class makes a virtual function call to a SpreadTo method, which is different for each of the derived classes. Years ago, I was tracing the parent function, and probably followed it into some blight related code at the virtual function call and didn't notice it may only apply to one of the derived classes. I likely documented the behavior as applying to both derived classes, and the info has been wrong ever since then. This means the comment is probably in error.
From what I'm seeing of the Lava.SpreadTo function, it seems to only check if Lava is present around surrounding tiles. The more complicated Blight.SpreadTo function uses both the expand and the blight present bits. It seems blight can only spread to a tile that's been previously marked with the expand bit. The expand bit seems to be set around tiles that are newly infected, although this isn't done until it's another two function call in. There is also a check to see if lava has already expanded to the tile, and will prevent blight expansion. From what I can tell, the expand bit appears like it was intended as a speed optimization, in that most of the spreading checks can be avoided for tiles that aren't around the frontier of the blight. I'm not certain of that though.