[8162] Fixed applying random enchantments to quest rewarded items.

Signed-off-by: ApoC <apoc@nymfe.net>
This commit is contained in:
ApoC 2009-07-11 20:38:34 +02:00
parent 45eda48693
commit 0dc7ea6cc2
2 changed files with 9 additions and 9 deletions

View file

@ -12540,12 +12540,12 @@ void Player::RewardQuest( Quest const *pQuest, uint32 reward, Object* questGiver
if (pQuest->GetRewChoiceItemsCount() > 0)
{
if (pQuest->RewChoiceItemId[reward])
if (uint32 itemId = pQuest->RewChoiceItemId[reward])
{
ItemPosCountVec dest;
if (CanStoreNewItem( NULL_BAG, NULL_SLOT, dest, pQuest->RewChoiceItemId[reward], pQuest->RewChoiceItemCount[reward] ) == EQUIP_ERR_OK)
if (CanStoreNewItem( NULL_BAG, NULL_SLOT, dest, itemId, pQuest->RewChoiceItemCount[reward] ) == EQUIP_ERR_OK)
{
Item* item = StoreNewItem( dest, pQuest->RewChoiceItemId[reward], true);
Item* item = StoreNewItem( dest, itemId, true, Item::GenerateItemRandomPropertyId(itemId));
SendNewItem(item, pQuest->RewChoiceItemCount[reward], true, false);
}
}
@ -12555,12 +12555,12 @@ void Player::RewardQuest( Quest const *pQuest, uint32 reward, Object* questGiver
{
for (uint32 i=0; i < pQuest->GetRewItemsCount(); ++i)
{
if (pQuest->RewItemId[i])
if (uint32 itemId = pQuest->RewItemId[i])
{
ItemPosCountVec dest;
if (CanStoreNewItem( NULL_BAG, NULL_SLOT, dest, pQuest->RewItemId[i], pQuest->RewItemCount[i] ) == EQUIP_ERR_OK)
if (CanStoreNewItem( NULL_BAG, NULL_SLOT, dest, itemId, pQuest->RewItemCount[i] ) == EQUIP_ERR_OK)
{
Item* item = StoreNewItem( dest, pQuest->RewItemId[i], true);
Item* item = StoreNewItem( dest, itemId, true, Item::GenerateItemRandomPropertyId(itemId));
SendNewItem(item, pQuest->RewItemCount[i], true, false);
}
}

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "8161"
#define REVISION_NR "8162"
#endif // __REVISION_NR_H__