I was idly looking through the code and came upon the following lines in buildingutil.cpp. These three functions appear to be intended to return the maximum offense bonus for buildings present in a city. However, the body of the code seems to look for the wrong building characteristics for both water and ar improvements. AFAICS this implies that improvements such as costal forts or flak guns do not function as expected. The correction appears obvious. Thoughts?
Code:
double buildingutil_GetOffenseBonusLand(const uint64 built_improvements) { double best = 0; FOREACH_BUILT(GetOffenseBonusLand) { double cur; if(rec->GetOffenseBonusLand(cur) && cur > best) best = cur; } return best; } double buildingutil_GetOffenseBonusWater(const uint64 built_improvements) { double best = 0; FOREACH_BUILT(GetOffenseBonusWater) { double cur; if(rec->GetOffenseBonusLand(cur) && cur > best) best = cur; } return best; } double buildingutil_GetOffenseBonusAir(const uint64 built_improvements) { double best = 0; FOREACH_BUILT(GetOffenseBonusWater) { double cur; if(rec->GetOffenseBonusLand(cur) && cur > best) best = cur; } return best; })
Comment