Fix a stupid off by one mistake
This commit is contained in:
parent
6baae3e00b
commit
2d652adddc
1 changed files with 2 additions and 2 deletions
|
@ -199,10 +199,10 @@ void FGClimate::update(double dt)
|
|||
// convert from color shades to koppen-classicfication
|
||||
_gl.elevation_m = 5600.0*color[1];
|
||||
_code = static_cast<int>(floorf(255.0f*color[0]/4.0f), 32.0);
|
||||
if (_code > MAX_CLIMATE_CLASSES)
|
||||
if (_code >= MAX_CLIMATE_CLASSES)
|
||||
{
|
||||
SG_LOG(SG_ENVIRONMENT, SG_WARN, "Climate Koppen code exceeds the maximum");
|
||||
_code = MAX_CLIMATE_CLASSES;
|
||||
_code = MAX_CLIMATE_CLASSES-1;
|
||||
}
|
||||
|
||||
if (_code == 0) set_ocean();
|
||||
|
|
Loading…
Add table
Reference in a new issue