mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-14 17:49:10 +00:00
feat(Core/Scripting): Implement OnAllowedToLootContainerCheck() hook (#17209)
* chore(Core/Loot): Move OnAllowedForPlayerLootCheck() hook call up * Revert "chore(Core/Loot): Move OnAllowedForPlayerLootCheck() hook call up" This reverts commit f841ef9da313976179fb788d9573ff8ced05ecb9. * feat(Core/Scripting): Implement OnAllowedToLootContainerCheck() hook * Update GlobalScript.cpp
This commit is contained in:
@@ -178,6 +178,21 @@ bool ScriptMgr::OnAllowedForPlayerLootCheck(Player const* player, ObjectGuid sou
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ScriptMgr::OnAllowedToLootContainerCheck(Player const* player, ObjectGuid source)
|
||||
{
|
||||
auto ret = IsValidBoolScript<GlobalScript>([&](GlobalScript* script)
|
||||
{
|
||||
return script->OnAllowedToLootContainerCheck(player, source);
|
||||
});
|
||||
|
||||
if (ret && *ret)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Called when an instance Id is deleted, usually because it expired or no players are bound to it anymore.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user