feat(Core/Disables): Implement DISABLE_TYPE_LOOT (#15136)

This commit is contained in:
Skjalf
2023-02-19 19:20:15 -03:00
committed by GitHub
parent 86966bae73
commit a4dcec5e42
3 changed files with 19 additions and 3 deletions

View File

@@ -17,6 +17,7 @@
#include "LootMgr.h"
#include "Containers.h"
#include "DisableMgr.h"
#include "Group.h"
#include "Log.h"
#include "ObjectMgr.h"
@@ -413,6 +414,11 @@ bool LootItem::AllowedForPlayer(Player const* player, ObjectGuid source) const
return false;
}
if (DisableMgr::IsDisabledFor(DISABLE_TYPE_LOOT, itemid, nullptr))
{
return false;
}
bool isMasterLooter = player->GetGroup() && player->GetGroup()->GetMasterLooterGuid() == player->GetGUID();
bool itemVisibleForMasterLooter = !needs_quest && (!follow_loot_rules || !is_underthreshold);