Core/Players: Drop Player::SaveGoldToDB() and move it's code to Player::SaveInventoryAndGoldToDB()
Port From (https://github.com/TrinityCore/TrinityCore/commit/02b977c98ec26bc21cb3e779e60e16a7587bfcb9)
This commit is contained in:
@@ -1316,7 +1316,7 @@ namespace Game
|
||||
}
|
||||
|
||||
player.ModifyMoney(-(long)totalPrice);
|
||||
player.SaveGoldToDB(trans);
|
||||
player.SaveInventoryAndGoldToDB(trans);
|
||||
|
||||
foreach (MailedItemsBatch batch in items)
|
||||
{
|
||||
|
||||
@@ -2590,18 +2590,15 @@ namespace Game.Entities
|
||||
|
||||
trans.Append(stmt);
|
||||
}
|
||||
public void SaveGoldToDB(SQLTransaction trans)
|
||||
{
|
||||
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.UPD_CHAR_MONEY);
|
||||
stmt.AddValue(0, GetMoney());
|
||||
stmt.AddValue(1, GetGUID().GetCounter());
|
||||
trans.Append(stmt);
|
||||
}
|
||||
public void SaveInventoryAndGoldToDB(SQLTransaction trans)
|
||||
{
|
||||
_SaveInventory(trans);
|
||||
_SaveCurrency(trans);
|
||||
SaveGoldToDB(trans);
|
||||
|
||||
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.UPD_CHAR_MONEY);
|
||||
stmt.AddValue(0, GetMoney());
|
||||
stmt.AddValue(1, GetGUID().GetCounter());
|
||||
trans.Append(stmt);
|
||||
}
|
||||
void _SaveEquipmentSets(SQLTransaction trans)
|
||||
{
|
||||
|
||||
@@ -902,7 +902,7 @@ namespace Game.Guilds
|
||||
if (!cashFlow)
|
||||
{
|
||||
player.ModifyMoney(-(long)amount);
|
||||
player.SaveGoldToDB(trans);
|
||||
player.SaveInventoryAndGoldToDB(trans);
|
||||
}
|
||||
|
||||
_LogBankEvent(trans, cashFlow ? GuildBankEventLogTypes.CashFlowDeposit : GuildBankEventLogTypes.DepositMoney, 0, player.GetGUID().GetCounter(), (uint)amount);
|
||||
@@ -947,7 +947,7 @@ namespace Game.Guilds
|
||||
if (!player.ModifyMoney((long)amount))
|
||||
return false;
|
||||
|
||||
player.SaveGoldToDB(trans);
|
||||
player.SaveInventoryAndGoldToDB(trans);
|
||||
}
|
||||
|
||||
// Update remaining money amount
|
||||
|
||||
@@ -532,7 +532,7 @@ namespace Game
|
||||
|
||||
// save money and mail to prevent cheating
|
||||
SQLTransaction trans = new();
|
||||
player.SaveGoldToDB(trans);
|
||||
player.SaveInventoryAndGoldToDB(trans);
|
||||
player._SaveMail(trans);
|
||||
DB.Characters.CommitTransaction(trans);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user