refactor(Core/Game): restyle game lib with astyle (#3466)

This commit is contained in:
Kargatum
2020-10-12 15:08:15 +07:00
committed by GitHub
parent e99b526e17
commit a2b26272d2
338 changed files with 52196 additions and 50944 deletions

View File

@@ -27,7 +27,7 @@ Weather::Weather(uint32 zone, WeatherData const* weatherChances)
m_grade = 0;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
sLog->outDetail("WORLD: Starting weather system for zone %u (change every %u minutes).", m_zone, (uint32)(m_timer.GetInterval() / (MINUTE*IN_MILLISECONDS)));
sLog->outDetail("WORLD: Starting weather system for zone %u (change every %u minutes).", m_zone, (uint32)(m_timer.GetInterval() / (MINUTE * IN_MILLISECONDS)));
#endif
}
@@ -85,7 +85,7 @@ bool Weather::ReGenerate()
time_t gtime = sWorld->GetGameTime();
struct tm ltime;
localtime_r(&gtime, &ltime);
uint32 season = ((ltime.tm_yday - 78 + 365)/91)%4;
uint32 season = ((ltime.tm_yday - 78 + 365) / 91) % 4;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
static char const* seasonName[WEATHER_SEASONS] = { "spring", "summer", "fall", "winter" };
@@ -126,7 +126,7 @@ bool Weather::ReGenerate()
{
if (m_grade > 0.6666667f)
{
// Severe change, but how severe?
// Severe change, but how severe?
uint32 rnd = urand(0, 99);
if (rnd < 50)
{
@@ -141,8 +141,8 @@ bool Weather::ReGenerate()
// At this point, only weather that isn't doing anything remains but that have weather data
uint32 chance1 = m_weatherChances->data[season].rainChance;
uint32 chance2 = chance1+ m_weatherChances->data[season].snowChance;
uint32 chance3 = chance2+ m_weatherChances->data[season].stormChance;
uint32 chance2 = chance1 + m_weatherChances->data[season].snowChance;
uint32 chance3 = chance2 + m_weatherChances->data[season].stormChance;
uint32 rnd = urand(0, 99);
if (rnd <= chance1)
@@ -277,29 +277,29 @@ void Weather::SetWeather(WeatherType type, float grade)
/// Get the sound number associated with the current weather
WeatherState Weather::GetWeatherState() const
{
if (m_grade<0.27f)
if (m_grade < 0.27f)
return WEATHER_STATE_FINE;
switch (m_type)
{
case WEATHER_TYPE_RAIN:
if (m_grade<0.40f)
if (m_grade < 0.40f)
return WEATHER_STATE_LIGHT_RAIN;
else if (m_grade<0.70f)
else if (m_grade < 0.70f)
return WEATHER_STATE_MEDIUM_RAIN;
else
return WEATHER_STATE_HEAVY_RAIN;
case WEATHER_TYPE_SNOW:
if (m_grade<0.40f)
if (m_grade < 0.40f)
return WEATHER_STATE_LIGHT_SNOW;
else if (m_grade<0.70f)
else if (m_grade < 0.70f)
return WEATHER_STATE_MEDIUM_SNOW;
else
return WEATHER_STATE_HEAVY_SNOW;
case WEATHER_TYPE_STORM:
if (m_grade<0.40f)
if (m_grade < 0.40f)
return WEATHER_STATE_LIGHT_SANDSTORM;
else if (m_grade<0.70f)
else if (m_grade < 0.70f)
return WEATHER_STATE_MEDIUM_SANDSTORM;
else
return WEATHER_STATE_HEAVY_SANDSTORM;