Core/Loot: Fixed crash happening when looting items into new stack or items with random properties
Closes #17700
This commit is contained in:
@@ -778,8 +778,7 @@ void Item::SetItemRandomProperties(int32 randomPropId)
|
||||
|
||||
if (randomPropId > 0)
|
||||
{
|
||||
ItemRandomPropertiesEntry const* item_rand = sItemRandomPropertiesStore.LookupEntry(-randomPropId);
|
||||
if (sItemRandomPropertiesStore.LookupEntry(randomPropId))
|
||||
if (ItemRandomPropertiesEntry const* item_rand = sItemRandomPropertiesStore.LookupEntry(randomPropId))
|
||||
{
|
||||
if (GetInt32Value(ITEM_FIELD_RANDOM_PROPERTIES_ID) != randomPropId)
|
||||
{
|
||||
@@ -792,8 +791,7 @@ void Item::SetItemRandomProperties(int32 randomPropId)
|
||||
}
|
||||
else
|
||||
{
|
||||
ItemRandomSuffixEntry const* item_rand = sItemRandomSuffixStore.LookupEntry(-randomPropId);
|
||||
if (item_rand)
|
||||
if (ItemRandomSuffixEntry const* item_rand = sItemRandomSuffixStore.LookupEntry(-randomPropId))
|
||||
{
|
||||
if (GetInt32Value(ITEM_FIELD_RANDOM_PROPERTIES_ID) != randomPropId || !GetItemSuffixFactor())
|
||||
{
|
||||
|
||||
@@ -11544,7 +11544,7 @@ Item* Player::StoreItem(ItemPosCountVec const& dest, Item* pItem, bool update)
|
||||
lastItem = _StoreItem(pos, pItem, count, true, update);
|
||||
}
|
||||
|
||||
AutoUnequipChildItem(pItem);
|
||||
AutoUnequipChildItem(lastItem);
|
||||
|
||||
return lastItem;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user