Core/BattlePets: Delete declined names of non-account battle pets when deleting character permanently

Port From (https://github.com/TrinityCore/TrinityCore/commit/fa3cba3a00bbb6286499818f6a1f8675579a9d78)
This commit is contained in:
hondacrx
2022-05-04 10:43:57 -04:00
parent ecf40cda7e
commit a43d074c9f
2 changed files with 8 additions and 1 deletions
@@ -159,6 +159,7 @@ namespace Framework.Database
PrepareStatement(LoginStatements.DEL_BATTLE_PET_SLOTS, "DELETE FROM battle_pet_slots WHERE battlenetAccountId = ?");
PrepareStatement(LoginStatements.INS_BATTLE_PET_DECLINED_NAME, "INSERT INTO battle_pet_declinedname (guid, genitive, dative, accusative, instrumental, prepositional) VALUES (?, ?, ?, ?, ?, ?)");
PrepareStatement(LoginStatements.DEL_BATTLE_PET_DECLINED_NAME, "DELETE FROM battle_pet_declinedname WHERE guid = ?");
PrepareStatement(LoginStatements.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 = ?");
PrepareStatement(LoginStatements.SEL_ACCOUNT_HEIRLOOMS, "SELECT itemId, flags FROM battlenet_account_heirlooms WHERE accountId = ?");
PrepareStatement(LoginStatements.REP_ACCOUNT_HEIRLOOMS, "REPLACE INTO battlenet_account_heirlooms (accountId, itemId, flags) VALUES (?, ?, ?)");
@@ -304,6 +305,7 @@ namespace Framework.Database
DEL_BATTLE_PET_SLOTS,
INS_BATTLE_PET_DECLINED_NAME,
DEL_BATTLE_PET_DECLINED_NAME,
DEL_BATTLE_PET_DECLINED_NAME_BY_OWNER,
SEL_ACCOUNT_HEIRLOOMS,
REP_ACCOUNT_HEIRLOOMS,
+6 -1
View File
@@ -4236,9 +4236,14 @@ namespace Game.Entities
stmt.AddValue(0, guid);
trans.Append(stmt);
stmt = DB.Login.GetPreparedStatement(LoginStatements.DEL_BATTLE_PET_DECLINED_NAME_BY_OWNER);
stmt.AddValue(0, guid);
stmt.AddValue(1, Global.WorldMgr.GetRealmId().Index);
loginTransaction.Append(stmt);
stmt = DB.Login.GetPreparedStatement(LoginStatements.DEL_BATTLE_PETS_BY_OWNER);
stmt.AddValue(0, guid);
stmt.AddValue(0, Global.WorldMgr.GetRealmId().Index);
stmt.AddValue(1, Global.WorldMgr.GetRealmId().Index);
loginTransaction.Append(stmt);
Corpse.DeleteFromDB(playerGuid, trans);