Trinitycore: [3.3.5] Core/Item: Master Looter Item visibility problem

Created on 2 Mar 2020  路  8Comments  路  Source: TrinityCore/TrinityCore

Description:

Master Looter cant see items that provide Quests.
Original Issue #16653
PR and commit that should have fixed this issue : #23410 -> e6ad9b1

Image 1

Image 2

Current behaviour:

ML cant see Quest Items.

Expected behaviour:

ML should be able to see and assign Quest Items.

Steps to reproduce the problem:

Create a Raid with at least 2 Characters.
Set Lootrules to ML.
.go c 49678
kill and loot

Branch(es):

3.3.5

TC rev. hash/commit:

ce449f6

Operating system:

Windows 10

Branch-3.3.5a Comp-Core Feedback-PatchFix Sub-Loot

Most helpful comment

what you need to do, is just to add master looter checks in this code block

Its one of possible fixes but maybe needs more adjustments,

    if ((needs_quest && player->HasQuestForItem(itemid)) || (pProto->StartQuest && player->GetQuestStatus(pProto->StartQuest) == QUEST_STATUS_NONE))
                return true;

overall:

    // Master looter can see certain items even if the character can't loot them
    if (!isGivenByMasterLooter && player->GetGroup() && player->GetGroup()->GetMasterLooterGuid() == player->GetGUID())
    {
        // check quest requirements
        if (!(pProto->FlagsCu & ITEM_FLAGS_CU_IGNORE_QUEST_STATUS) && (needs_quest || pProto->StartQuest))
        {
            if ((needs_quest && player->HasQuestForItem(itemid)) || (pProto->StartQuest && player->GetQuestStatus(pProto->StartQuest) == QUEST_STATUS_NONE))
                return true;

            return false;
        }
        return true;
    }

All 8 comments

This will fix the issue, but not sure if it's the correct way:
``` diff
diff --git a/src/server/game/Loot/Loot.cpp b/src/server/game/Loot/Loot.cpp
index 3cd0762b27..89fd613a64 100644
--- a/src/server/game/Loot/Loot.cpp
+++ b/src/server/game/Loot/Loot.cpp
@@ -75,7 +75,7 @@ bool LootItem::AllowedForPlayer(Player const* player, bool isGivenByMasterLooter
if (!isGivenByMasterLooter && player->GetGroup() && player->GetGroup()->GetMasterLooterGuid() == player->GetGUID())
{
// check quest requirements
- if (!pProto->HasFlag(ITEM_FLAGS_CU_IGNORE_QUEST_STATUS) && (needs_quest || pProto->StartQuest))
+ if (!pProto->HasFlag(ITEM_FLAGS_CU_IGNORE_QUEST_STATUS) && (needs_quest))
return false;

     return true;

what you need to do, is just to add master looter checks in this code block

Its one of possible fixes but maybe needs more adjustments,

    if ((needs_quest && player->HasQuestForItem(itemid)) || (pProto->StartQuest && player->GetQuestStatus(pProto->StartQuest) == QUEST_STATUS_NONE))
                return true;

overall:

    // Master looter can see certain items even if the character can't loot them
    if (!isGivenByMasterLooter && player->GetGroup() && player->GetGroup()->GetMasterLooterGuid() == player->GetGUID())
    {
        // check quest requirements
        if (!(pProto->FlagsCu & ITEM_FLAGS_CU_IGNORE_QUEST_STATUS) && (needs_quest || pProto->StartQuest))
        {
            if ((needs_quest && player->HasQuestForItem(itemid)) || (pProto->StartQuest && player->GetQuestStatus(pProto->StartQuest) == QUEST_STATUS_NONE))
                return true;

            return false;
        }
        return true;
    }

the problem is still relevant for 400e291

At first glance your fix seems to be working @sanctum32

I think the @sanctum32 fix is not entirely correct because for example:
Onyxia case:
Player A (Masterlooter) has the head of onyxia and quest, so has queststatus != None
Raid kill onyxia and Player A can't see onyxia's head, therefore cannot give head to anyone

Maybe we should check all group members in that Masterlooter check and check if any member of the group is able to get the item

Looks like a logical solution to me, to make sure that all members are checked for eligibility.

All members who are possibly eligible for loot should be checked every time, in every loot system except free for all (maybe even then still).

@Jildor In a blizzard, even players who can't scavenge can pick up from corpses!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ZenoX92 picture ZenoX92  路  3Comments

DDuarte picture DDuarte  路  3Comments

jerbookins picture jerbookins  路  3Comments

chilito picture chilito  路  3Comments

Keader picture Keader  路  3Comments