mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-16 02:20:27 +00:00
feat(Core/ScriptMgr): correct execute bool hooks (#9574)
This commit is contained in:
@@ -21,20 +21,18 @@
|
||||
#include "ScriptMgr.h"
|
||||
|
||||
template<typename ScriptName, typename TCallBack>
|
||||
inline bool GetReturnBoolScripts(bool ret, TCallBack&& callback)
|
||||
inline Optional<bool> IsValidBoolScript(TCallBack&& callback)
|
||||
{
|
||||
if (ScriptRegistry<ScriptName>::ScriptPointerList.empty())
|
||||
return ret;
|
||||
|
||||
bool needReturn = !ret;
|
||||
return {};
|
||||
|
||||
for (auto const& [scriptID, script] : ScriptRegistry<ScriptName>::ScriptPointerList)
|
||||
{
|
||||
if (callback(script))
|
||||
return needReturn;
|
||||
return true;
|
||||
}
|
||||
|
||||
return ret;
|
||||
return false;
|
||||
}
|
||||
|
||||
template<class ScriptName, class T, typename TCallBack>
|
||||
|
||||
Reference in New Issue
Block a user