Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quest items in loot boxes disappear from the box after a relog #26719

Open
jackpoz opened this issue Jul 18, 2021 · 2 comments
Open

Quest items in loot boxes disappear from the box after a relog #26719

jackpoz opened this issue Jul 18, 2021 · 2 comments

Comments

@jackpoz
Copy link
Member

jackpoz commented Jul 18, 2021

Description

Quest items in loot boxes disappear from the box after relogging.

Expected behaviour

Quest items should still be present in the box, no matter how many relogs are done

Steps to reproduce the problem

  1. Create a deathknight
  2. .quest add 12720 https://tcubuntu.northeurope.cloudapp.azure.com/aowow/?quest=12720
  3. .addi 39418 https://tcubuntu.northeurope.cloudapp.azure.com/aowow/?item=39418
  4. Open the box without looting any item
    image
  5. Relog
  6. Open the box
  7. The box is empty
    image

Branch

3.3.5

TC rev. hash/commit

5094363 and d1e9131 , this issue is not caused by latest loot PR changes

Operating system

Windows 10 x64

Custom changes

None

@jackpoz
Copy link
Member Author

jackpoz commented Jul 18, 2021

@robinsch you might be interested in this

@jackpoz
Copy link
Member Author

jackpoz commented Jul 18, 2021

This is caused by

for (LootItem const& li : loot->items)
{
// Conditions are not checked when loot is generated, it is checked when loot is sent to a player.
// For items that are lootable, loot is saved to the DB immediately, that means that loot can be
// saved to the DB that the player never should have gotten. This check prevents that, so that only
// items that the player should get in loot are in the DB.
// IE: Horde items are not saved to the DB for Ally players.
if (!li.AllowedForPlayer(player))
continue;
// Don't save currency tokens
ItemTemplate const* itemTemplate = sObjectMgr->GetItemTemplate(li.itemid);
if (!itemTemplate || itemTemplate->IsCurrencyToken())
continue;
container.AddLootItem(li, trans);
}
taking into account only loot->items and ignoring loot->quest_items

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants