Not working, adding debug console flagging to troubleshoot

This commit is contained in:
Flerp 2025-11-04 17:52:20 -08:00
parent c12e7aded0
commit b26156d05e

View File

@ -24,13 +24,20 @@ public:
Player* player = isPet ? attacker->GetOwner()->ToPlayer() : attacker->ToPlayer(); Player* player = isPet ? attacker->GetOwner()->ToPlayer() : attacker->ToPlayer();
uint32 requiredItem = sConfigMgr->GetOption<uint32>("Leech.RequiredItemId", 0u); int32 requiredItemSigned = sConfigMgr->GetOption<int32>("Leech.RequiredItemId", 0);
if (requiredItem != 0) if (requiredItemSigned > 0)
{ {
if (!player || !player->HasItemCount(requiredItem, 1, false)) uint32 requiredItem = uint32(requiredItemSigned);
if (!player || !player->HasItemCount(requiredItem, 1, false , false , true ))
{ {
if (sConfigMgr->GetOption<bool>("Leech.Debug", false))
LOG_DEBUG("module", "mod-leech: blocked (missing item {})", requiredItem);
return; return;
} }
else if (sConfigMgr->GetOption<bool>("Leech.Debug", false))
{
LOG_DEBUG("module", "mod-leech: allowed (has item {})", requiredItem);
}
} }
if (sConfigMgr->GetOption<bool>("Leech.DungeonsOnly", true) && !(player->GetMap()->IsDungeon())) if (sConfigMgr->GetOption<bool>("Leech.DungeonsOnly", true) && !(player->GetMap()->IsDungeon()))
{ {