mirror of
https://github.com/liyunfan1223/mod-playerbots.git
synced 2026-02-20 18:10:02 +01:00
Set correct owner for randombot items to prevent crash when applying enchants
This commit is contained in:
parent
41bcfbfcb6
commit
6d56c5c5c3
@ -1061,6 +1061,7 @@ void PlayerbotFactory::InitEquipmentNew(bool incremental)
|
|||||||
newItem->AddToWorld();
|
newItem->AddToWorld();
|
||||||
newItem->AddToUpdateQueueOf(bot);
|
newItem->AddToUpdateQueueOf(bot);
|
||||||
bot->AutoUnequipOffhandIfNeed();
|
bot->AutoUnequipOffhandIfNeed();
|
||||||
|
newItem->SetOwnerGUID(bot->GetGUID());
|
||||||
EnchantItem(newItem);
|
EnchantItem(newItem);
|
||||||
LOG_INFO("playerbots", "Bot {} {}:{} <{}>: Equip: {}, slot: {}, Old item: {}",
|
LOG_INFO("playerbots", "Bot {} {}:{} <{}>: Equip: {}, slot: {}, Old item: {}",
|
||||||
bot->GetGUID().ToString().c_str(), IsAlliance(bot->getRace()) ? "A" : "H", bot->getLevel(), bot->GetName(), newItemId, slot, itemInSlot);
|
bot->GetGUID().ToString().c_str(), IsAlliance(bot->getRace()) ? "A" : "H", bot->getLevel(), bot->GetName(), newItemId, slot, itemInSlot);
|
||||||
@ -1086,6 +1087,7 @@ void PlayerbotFactory::InitEquipmentNew(bool incremental)
|
|||||||
if (newItem)
|
if (newItem)
|
||||||
{
|
{
|
||||||
bot->AutoUnequipOffhandIfNeed();
|
bot->AutoUnequipOffhandIfNeed();
|
||||||
|
newItem->SetOwnerGUID(bot->GetGUID());
|
||||||
EnchantItem(newItem);
|
EnchantItem(newItem);
|
||||||
found = true;
|
found = true;
|
||||||
LOG_INFO("playerbots", "Bot {} {}:{} <{}>: Equip: {}, slot: {}",
|
LOG_INFO("playerbots", "Bot {} {}:{} <{}>: Equip: {}, slot: {}",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user