From 8b1a8bee3437f5d8f865e77e27ae15ad4c690f10 Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Wed, 13 Feb 2013 19:22:08 +0000 Subject: Added HOOK_WEATHER_CHANGING. http://www.mc-server.org/support/index.php?do=details&task_id=299 git-svn-id: http://mc-server.googlecode.com/svn/trunk@1210 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/PluginManager.cpp | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'source/PluginManager.cpp') 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); -- cgit v1.2.3