summaryrefslogtreecommitdiffstats
path: root/source/PluginManager.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--source/PluginManager.cpp23
1 files changed, 22 insertions, 1 deletions
diff --git a/source/PluginManager.cpp b/source/PluginManager.cpp
index 8ff4f4e8f..c80c512a0 100644
--- a/source/PluginManager.cpp
+++ b/source/PluginManager.cpp
@@ -905,7 +905,7 @@ bool cPluginManager::CallHookUpdatedSign(cWorld * a_World, int a_BlockX, int a_B
-bool cPluginManager::CallHookWeatherChanged(cWorld * a_World)
+bool cPluginManager::CallHookWeatherChanged(cWorld & a_World)
{
HookMap::iterator Plugins = m_Hooks.find(HOOK_WEATHER_CHANGED);
if (Plugins == m_Hooks.end())
@@ -926,6 +926,27 @@ bool cPluginManager::CallHookWeatherChanged(cWorld * a_World)
+bool cPluginManager::CallHookWeatherChanging(cWorld & a_World, eWeather & a_NewWeather)
+{
+ HookMap::iterator Plugins = m_Hooks.find(HOOK_WEATHER_CHANGING);
+ if (Plugins == m_Hooks.end())
+ {
+ return false;
+ }
+ for (PluginList::iterator itr = Plugins->second.begin(); itr != Plugins->second.end(); ++itr)
+ {
+ if ((*itr)->OnWeatherChanging(a_World, a_NewWeather))
+ {
+ return true;
+ }
+ }
+ return false;
+}
+
+
+
+
+
bool cPluginManager::HandleCommand(cPlayer * a_Player, const AString & a_Command, bool a_ShouldCheckPermissions)
{
ASSERT(a_Player != NULL);