aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/game/Mail.cpp2
-rw-r--r--src/game/Player.cpp2
-rw-r--r--src/game/TradeHandler.cpp5
3 files changed, 7 insertions, 2 deletions
diff --git a/src/game/Mail.cpp b/src/game/Mail.cpp
index 428d2870b9f..3376d74e017 100644
--- a/src/game/Mail.cpp
+++ b/src/game/Mail.cpp
@@ -247,6 +247,7 @@ void WorldSession::HandleSendMail(WorldPacket & recv_data )
GetPlayerName(), GetAccountId(), item->GetProto()->Name1, item->GetEntry(), item->GetCount(), receiver.c_str(), rc_account);
}
+ item->SetNotRefundable(GetPlayer()); // makes the item no longer refundable
pl->MoveItemFromInventory(items[i]->GetBagSlot(), item->GetSlot(), true);
CharacterDatabase.BeginTransaction();
item->DeleteFromInventoryDB(); // deletes item from character's inventory
@@ -254,7 +255,6 @@ void WorldSession::HandleSendMail(WorldPacket & recv_data )
// owner in data will set at mail receive and item extracting
CharacterDatabase.PExecute("UPDATE item_instance SET owner_guid = '%u' WHERE guid='%u'", GUID_LOPART(rc), item->GetGUIDLow());
CharacterDatabase.CommitTransaction();
-
draft.AddItem(item);
}
diff --git a/src/game/Player.cpp b/src/game/Player.cpp
index bd486e29d0b..5c163ac3720 100644
--- a/src/game/Player.cpp
+++ b/src/game/Player.cpp
@@ -17494,7 +17494,7 @@ void Player::_SaveInventory()
// Item could be deleted, or traded.
// In the first case, DeleteRefundDataFromDB() was already called in Item::SaveToDB()
Item* iPtr = (*itr);
- if (!iPtr || iPtr->GetOwner() != this)
+ if (!iPtr)
m_refundableItems.erase(itr++);
else
{
diff --git a/src/game/TradeHandler.cpp b/src/game/TradeHandler.cpp
index 64c1d8e904c..7baf068708a 100644
--- a/src/game/TradeHandler.cpp
+++ b/src/game/TradeHandler.cpp
@@ -202,6 +202,9 @@ void WorldSession::moveItems(Item* myItems[], Item* hisItems[])
_player->pTrader->GetName(),_player->pTrader->GetSession()->GetAccountId());
}
+
+ // make not refundable
+ myItems[i]->SetNotRefundable(_player);
// store
_player->pTrader->MoveItemToInventory( traderDst, myItems[i], true, true);
}
@@ -217,6 +220,8 @@ void WorldSession::moveItems(Item* myItems[], Item* hisItems[])
_player->GetName(),_player->GetSession()->GetAccountId());
}
+ // make not refundable
+ hisItems[i]->SetNotRefundable(_player->pTrader);
// store
_player->MoveItemToInventory( playerDst, hisItems[i], true, true);
}