diff options
Diffstat (limited to 'src/game/Item.cpp')
-rw-r--r-- | src/game/Item.cpp | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/src/game/Item.cpp b/src/game/Item.cpp index 9927a936bc1..cbb27666033 100644 --- a/src/game/Item.cpp +++ b/src/game/Item.cpp @@ -1057,15 +1057,11 @@ void Item::BuildUpdate(UpdateDataMapType& data_map) void Item::SaveRefundDataToDB() { - std::ostringstream ss; - ss << "INSERT INTO item_refund_instance VALUES("; - ss << GetGUIDLow() << ","; - ss << GetRefundRecipient() << ","; - ss << GetPaidMoney() << ","; - ss << GetPaidExtendedCost(); - ss << ")"; - - CharacterDatabase.Execute(ss.str().c_str()); + CharacterDatabase.BeginTransaction(); + CharacterDatabase.PExecute("DELETE FROM item_refund_instance WHERE item_guid = '%u'", GetGUIDLow()); + CharacterDatabase.PExecute("INSERT INTO item_refund_instance (`item_guid`,`player_guid`,`paidMoney`,`paidExtendedCost`)" + " VALUES('%u','%u','%u','%u')", GetGUIDLow(), GetRefundRecipient(), GetPaidMoney(), GetPaidExtendedCost()); + CharacterDatabase.CommitTransaction(); } void Item::DeleteRefundDataFromDB() |