mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-19 08:55:32 +01:00
Core/DBLayer: Convert PAppend() queries to prepared statements No.1
This commit is contained in:
@@ -568,8 +568,18 @@ void ReputationMgr::SaveToDB(SQLTransaction& trans)
|
||||
{
|
||||
if (itr->second.needSave)
|
||||
{
|
||||
trans->PAppend("DELETE FROM character_reputation WHERE guid = '%u' AND faction='%u'", _player->GetGUIDLow(), itr->second.ID);
|
||||
trans->PAppend("INSERT INTO character_reputation (guid, faction, standing, flags) VALUES ('%u', '%u', '%i', '%u')", _player->GetGUIDLow(), itr->second.ID, itr->second.Standing, itr->second.Flags);
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_REPUTATION_BY_FACTION);
|
||||
stmt->setUInt32(0, _player->GetGUIDLow());
|
||||
stmt->setUInt16(1, uint16(itr->second.ID));
|
||||
trans->Append(stmt);
|
||||
|
||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHAR_REPUTATION_BY_FACTION);
|
||||
stmt->setUInt32(0, _player->GetGUIDLow());
|
||||
stmt->setUInt16(1, uint16(itr->second.ID));
|
||||
stmt->setInt32(2, itr->second.Standing);
|
||||
stmt->setUInt16(3, uint16(itr->second.Flags));
|
||||
trans->Append(stmt);
|
||||
|
||||
itr->second.needSave = false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user