Skip to content

Commit

Permalink
Creature: Fix CreatureStaticFlags::CAN_WIELD_LOOT
Browse files Browse the repository at this point in the history
  • Loading branch information
killerwife committed Dec 27, 2024
1 parent 76b59c1 commit b7c2611
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/game/Entities/Creature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -425,10 +425,10 @@ bool Creature::InitEntry(uint32 Entry, CreatureData const* data /*=nullptr*/, Ga
SetVirtualItem(VIRTUAL_ITEM_SLOT_0, mh);

if (oh != 0)
SetVirtualItem(VIRTUAL_ITEM_SLOT_0, oh);
SetVirtualItem(VIRTUAL_ITEM_SLOT_1, oh);

if (ranged != 0)
SetVirtualItem(VIRTUAL_ITEM_SLOT_0, ranged);
SetVirtualItem(VIRTUAL_ITEM_SLOT_2, ranged);
}
}
}
Expand Down
12 changes: 6 additions & 6 deletions src/game/Loot/LootMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1666,16 +1666,16 @@ Loot::Loot(Player* player, Creature* creature, LootType type) :
m_clientLootType(CLIENT_LOOT_CORPSE), m_lootMethod(NOT_GROUP_TYPE_LOOT), m_threshold(ITEM_QUALITY_UNCOMMON), m_maxEnchantSkill(0), m_haveItemOverThreshold(false),
m_isChecked(false), m_isChest(false), m_isChanged(false), m_isFakeLoot(false), m_createTime(World::GetCurrentClockTime())
{
// the player whose group may loot the corpse
if (!player)
if (!creature)
{
sLog.outError("LootMgr::CreateLoot> Error cannot get looter info to create loot!");
sLog.outError("Loot::CreateLoot> cannot create loot, no creature passed!");
return;
}

if (!creature)
// the player whose group may loot the corpse
if (!player && !creature->GetSettings().HasFlag(CreatureStaticFlags::CAN_WIELD_LOOT))
{
sLog.outError("Loot::CreateLoot> cannot create loot, no creature passed!");
sLog.outError("LootMgr::CreateLoot> Error cannot get looter info to create loot!");
return;
}

Expand All @@ -1693,7 +1693,7 @@ Loot::Loot(Player* player, Creature* creature, LootType type) :
if (threatEntry->getTarget()->IsPlayer())
m_ownerSet.insert(threatEntry->getTarget()->GetObjectGuid());
}
else
else if (player)
// setting loot right
SetGroupLootRight(player);
m_clientLootType = CLIENT_LOOT_CORPSE;
Expand Down

0 comments on commit b7c2611

Please sign in to comment.