From 3582e91165d252e9fa21da7ee0818ec741b1bc10 Mon Sep 17 00:00:00 2001 From: VladimirMangos Date: Wed, 23 Jun 2010 10:50:29 +0400 Subject: [PATCH] [10100] Fixed some cases assign low guid to full guid update field. --- src/game/Item.cpp | 8 ++++---- src/game/ItemHandler.cpp | 22 +++++++++++----------- src/game/Mail.cpp | 2 +- src/game/SpellEffects.cpp | 2 +- src/game/TradeHandler.cpp | 4 ++-- src/shared/revision_nr.h | 2 +- 6 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/game/Item.cpp b/src/game/Item.cpp index b8d71b7e217..146d735e03c 100644 --- a/src/game/Item.cpp +++ b/src/game/Item.cpp @@ -969,10 +969,10 @@ Item* Item::CloneItem( uint32 count, Player const* player ) const if(!newItem) return NULL; - newItem->SetUInt32Value( ITEM_FIELD_CREATOR, GetUInt32Value( ITEM_FIELD_CREATOR ) ); - newItem->SetUInt32Value( ITEM_FIELD_GIFTCREATOR, GetUInt32Value( ITEM_FIELD_GIFTCREATOR ) ); - newItem->SetUInt32Value( ITEM_FIELD_FLAGS, GetUInt32Value( ITEM_FIELD_FLAGS ) ); - newItem->SetUInt32Value( ITEM_FIELD_DURATION, GetUInt32Value( ITEM_FIELD_DURATION ) ); + newItem->SetGuidValue(ITEM_FIELD_CREATOR, GetGuidValue(ITEM_FIELD_CREATOR)); + newItem->SetGuidValue(ITEM_FIELD_GIFTCREATOR, GetGuidValue(ITEM_FIELD_GIFTCREATOR)); + newItem->SetUInt32Value(ITEM_FIELD_FLAGS, GetUInt32Value(ITEM_FIELD_FLAGS)); + newItem->SetUInt32Value(ITEM_FIELD_DURATION, GetUInt32Value(ITEM_FIELD_DURATION)); newItem->SetItemRandomProperties(GetItemRandomPropertyId()); return newItem; } diff --git a/src/game/ItemHandler.cpp b/src/game/ItemHandler.cpp index 41796a76b58..ba92cb47659 100644 --- a/src/game/ItemHandler.cpp +++ b/src/game/ItemHandler.cpp @@ -1052,13 +1052,13 @@ void WorldSession::HandleWrapItemOpcode(WorldPacket& recv_data) DEBUG_LOG("WRAP: receive gift_bag = %u, gift_slot = %u, item_bag = %u, item_slot = %u", gift_bag, gift_slot, item_bag, item_slot); Item *gift = _player->GetItemByPos( gift_bag, gift_slot ); - if(!gift) + if (!gift) { _player->SendEquipError( EQUIP_ERR_ITEM_NOT_FOUND, gift, NULL ); return; } - if(!gift->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAGS_WRAPPER))// cheating: non-wrapper wrapper + if (!gift->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAGS_WRAPPER))// cheating: non-wrapper wrapper { _player->SendEquipError( EQUIP_ERR_ITEM_NOT_FOUND, gift, NULL ); return; @@ -1066,50 +1066,50 @@ void WorldSession::HandleWrapItemOpcode(WorldPacket& recv_data) Item *item = _player->GetItemByPos( item_bag, item_slot ); - if( !item ) + if (!item) { _player->SendEquipError( EQUIP_ERR_ITEM_NOT_FOUND, item, NULL ); return; } - if(item == gift) // not possible with packet from real client + if (item == gift) // not possible with packet from real client { _player->SendEquipError( EQUIP_ERR_WRAPPED_CANT_BE_WRAPPED, item, NULL ); return; } - if(item->IsEquipped()) + if (item->IsEquipped()) { _player->SendEquipError( EQUIP_ERR_EQUIPPED_CANT_BE_WRAPPED, item, NULL ); return; } - if(item->GetUInt64Value(ITEM_FIELD_GIFTCREATOR)) // HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAGS_WRAPPED); + if (!item->GetGuidValue(ITEM_FIELD_GIFTCREATOR).IsEmpty())// HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAGS_WRAPPED); { _player->SendEquipError( EQUIP_ERR_WRAPPED_CANT_BE_WRAPPED, item, NULL ); return; } - if(item->IsBag()) + if (item->IsBag()) { _player->SendEquipError( EQUIP_ERR_BAGS_CANT_BE_WRAPPED, item, NULL ); return; } - if(item->IsSoulBound()) + if (item->IsSoulBound()) { _player->SendEquipError( EQUIP_ERR_BOUND_CANT_BE_WRAPPED, item, NULL ); return; } - if(item->GetMaxStackCount() != 1) + if (item->GetMaxStackCount() != 1) { _player->SendEquipError( EQUIP_ERR_STACKABLE_CANT_BE_WRAPPED, item, NULL ); return; } // maybe not correct check (it is better than nothing) - if(item->GetProto()->MaxCount > 0) + if (item->GetProto()->MaxCount > 0) { _player->SendEquipError( EQUIP_ERR_UNIQUE_CANT_BE_WRAPPED, item, NULL ); return; @@ -1128,7 +1128,7 @@ void WorldSession::HandleWrapItemOpcode(WorldPacket& recv_data) case 17307: item->SetEntry(17308); break; case 21830: item->SetEntry(21831); break; } - item->SetUInt64Value(ITEM_FIELD_GIFTCREATOR, _player->GetGUID()); + item->SetGuidValue(ITEM_FIELD_GIFTCREATOR, _player->GetObjectGuid()); item->SetUInt32Value(ITEM_FIELD_FLAGS, ITEM_FLAGS_WRAPPED); item->SetState(ITEM_CHANGED, _player); diff --git a/src/game/Mail.cpp b/src/game/Mail.cpp index b5eb6007b2e..e4d842a17fe 100644 --- a/src/game/Mail.cpp +++ b/src/game/Mail.cpp @@ -715,7 +715,7 @@ void WorldSession::HandleMailCreateTextItem(WorldPacket & recv_data ) else bodyItem->SetText(m->body); - bodyItem->SetUInt32Value(ITEM_FIELD_CREATOR, m->sender); + bodyItem->SetGuidValue(ITEM_FIELD_CREATOR, ObjectGuid(HIGHGUID_PLAYER, m->sender)); bodyItem->SetFlag(ITEM_FIELD_FLAGS, ITEM_FLAGS_WRAPPER | ITEM_FLAGS_UNK4 | ITEM_FLAGS_UNK1); diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index d8f6aac3a2a..218c5b91850 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -3365,7 +3365,7 @@ void Spell::DoCreateItem(SpellEffectIndex eff_idx, uint32 itemtype) // set the "Crafted by ..." property of the item if( pItem->GetProto()->Class != ITEM_CLASS_CONSUMABLE && pItem->GetProto()->Class != ITEM_CLASS_QUEST) - pItem->SetUInt32Value(ITEM_FIELD_CREATOR, player->GetGUIDLow()); + pItem->SetGuidValue(ITEM_FIELD_CREATOR, player->GetObjectGuid()); // send info to the client if(pItem) diff --git a/src/game/TradeHandler.cpp b/src/game/TradeHandler.cpp index 5fc3ec4c0cb..02281a53155 100644 --- a/src/game/TradeHandler.cpp +++ b/src/game/TradeHandler.cpp @@ -428,12 +428,12 @@ void WorldSession::HandleAcceptTradeOpcode(WorldPacket& recvPacket) { if (Item* item = myItems[i]) { - item->SetUInt64Value( ITEM_FIELD_GIFTCREATOR,_player->GetGUID()); + item->SetGuidValue(ITEM_FIELD_GIFTCREATOR, _player->GetObjectGuid()); _player->MoveItemFromInventory(item->GetBagSlot(), item->GetSlot(), true); } if (Item* item = hisItems[i]) { - item->SetUInt64Value( ITEM_FIELD_GIFTCREATOR, trader->GetGUID()); + item->SetGuidValue(ITEM_FIELD_GIFTCREATOR, trader->GetObjectGuid()); trader->MoveItemFromInventory(item->GetBagSlot(), item->GetSlot(), true); } } diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index fa14e9e9470..bfb1354b19c 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "10099" + #define REVISION_NR "10100" #endif // __REVISION_NR_H__