1
0

Fixed previous weather changes.

cWorld::GetDefaultWeatherInterval() returns -1 for unknown weather.
This commit is contained in:
madmaxoft 2014-03-03 20:55:04 +01:00
parent 71ae689eb7
commit 442c1d96fc
2 changed files with 5 additions and 4 deletions

View File

@ -325,8 +325,8 @@ int cWorld::GetDefaultWeatherInterval(eWeather a_Weather)
}
default:
{
LOGWARNING("Missing default weather interval for weather %d.", a_Weather);
return 1200;
LOGWARNING("%s: Missing default weather interval for weather %d.", __FUNCTION__, a_Weather);
return -1;
}
} // switch (Weather)
}
@ -348,7 +348,7 @@ void cWorld::SetWeather(eWeather a_NewWeather)
m_WeatherInterval = GetDefaultWeatherInterval(a_NewWeather);
// The weather can't be found:
if (m_WeatherInterval == 1200)
if (m_WeatherInterval < 0)
{
return;
}

View File

@ -139,7 +139,8 @@ public:
BroadcastTimeUpdate();
}
/** Returns the default weather interval for the specific weather type */
/** Returns the default weather interval for the specific weather type.
Returns -1 for any unknown weather. */
int GetDefaultWeatherInterval(eWeather a_Weather);
/** Returns the current game mode. Partly OBSOLETE, you should use IsGameModeXXX() functions wherever applicable */