I haven't looked into the code enough to know what it's doing about hab ranges. It could be that it is doing a theoretical spread.
As for the code, does this look like a bug to anyone else?
for (h = 0; h < 3; ++h)
{
int DesireFactor;
switch (h) {
case 0:
TTCorrFactor = TerraformFactor0();
DesireFactor = 7;
break;
case 1:
TTCorrFactor = TerraformFactor1();
DesireFactor = 5;
break;
case 2:
default:
TTCorrFactor = TerraformFactor2();
DesireFactor = 6;
break;
}
If you do a ++h wouldn't that cause h to never be 0, therefore you'd never get that DesireFactor of 7?