summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/World.cpp6
-rw-r--r--src/World.h3
2 files changed, 5 insertions, 4 deletions
diff --git a/src/World.cpp b/src/World.cpp
index 58d50d3a8..6ee0def91 100644
--- a/src/World.cpp
+++ b/src/World.cpp
@@ -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;
}
diff --git a/src/World.h b/src/World.h
index 27f1482e5..93397c014 100644
--- a/src/World.h
+++ b/src/World.h
@@ -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 */