Value locality_factor_per_year[i].factor is not used anywhere.
#else
// exponential evaluation
sint32 diff = (locality_factor_per_year[i].year-locality_factor_per_year[i-1].year);
double a = (double)diff*(exp((double)(year-locality_factor_per_year[i-1].year)/20.0)-1.0);
double b = (exp((double)(locality_factor_per_year[i].year-locality_factor_per_year[i-1].year)/20.0)-1.0);
return locality_factor_per_year[i-1].factor + (sint32)((diff*a)/b + 0.5);
#endif