mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Core/BattlePets: Delete declined names of non-account battle pets when deleting character permanently (#27706)
This commit is contained in:
@@ -170,6 +170,7 @@ void LoginDatabaseConnection::DoPrepareStatements()
|
||||
PrepareStatement(LOGIN_DEL_BATTLE_PET_SLOTS, "DELETE FROM battle_pet_slots WHERE battlenetAccountId = ?", CONNECTION_ASYNC);
|
||||
PrepareStatement(LOGIN_INS_BATTLE_PET_DECLINED_NAME, "INSERT INTO battle_pet_declinedname (guid, genitive, dative, accusative, instrumental, prepositional) VALUES (?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC);
|
||||
PrepareStatement(LOGIN_DEL_BATTLE_PET_DECLINED_NAME, "DELETE FROM battle_pet_declinedname WHERE guid = ?", CONNECTION_ASYNC);
|
||||
PrepareStatement(LOGIN_DEL_BATTLE_PET_DECLINED_NAME_BY_OWNER, "DELETE dn FROM battle_pet_declinedname dn INNER JOIN battle_pets bp ON dn.guid = bp.guid WHERE bp.owner = ? AND bp.ownerRealmId = ?", CONNECTION_ASYNC);
|
||||
|
||||
PrepareStatement(LOGIN_SEL_ACCOUNT_HEIRLOOMS, "SELECT itemId, flags FROM battlenet_account_heirlooms WHERE accountId = ?", CONNECTION_ASYNC);
|
||||
PrepareStatement(LOGIN_REP_ACCOUNT_HEIRLOOMS, "REPLACE INTO battlenet_account_heirlooms (accountId, itemId, flags) VALUES (?, ?, ?)", CONNECTION_ASYNC);
|
||||
|
||||
@@ -159,6 +159,7 @@ enum LoginDatabaseStatements : uint32
|
||||
LOGIN_DEL_BATTLE_PET_SLOTS,
|
||||
LOGIN_INS_BATTLE_PET_DECLINED_NAME,
|
||||
LOGIN_DEL_BATTLE_PET_DECLINED_NAME,
|
||||
LOGIN_DEL_BATTLE_PET_DECLINED_NAME_BY_OWNER,
|
||||
|
||||
LOGIN_SEL_ACCOUNT_HEIRLOOMS,
|
||||
LOGIN_REP_ACCOUNT_HEIRLOOMS,
|
||||
|
||||
@@ -4158,9 +4158,14 @@ void Player::DeleteFromDB(ObjectGuid playerguid, uint32 accountId, bool updateRe
|
||||
stmt->setUInt64(0, guid);
|
||||
trans->Append(stmt);
|
||||
|
||||
loginStmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_BATTLE_PET_DECLINED_NAME_BY_OWNER);
|
||||
loginStmt->setInt64(0, guid);
|
||||
loginStmt->setInt32(1, realm.Id.Realm);
|
||||
loginTransaction->Append(loginStmt);
|
||||
|
||||
loginStmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_BATTLE_PETS_BY_OWNER);
|
||||
loginStmt->setInt64(0, guid);
|
||||
loginStmt->setInt32(0, realm.Id.Realm);
|
||||
loginStmt->setInt32(1, realm.Id.Realm);
|
||||
loginTransaction->Append(loginStmt);
|
||||
|
||||
Corpse::DeleteFromDB(playerguid, trans);
|
||||
|
||||
Reference in New Issue
Block a user