Core/Pets: Adjust pet slot saving logic after constant changes

Port From (https://github.com/TrinityCore/TrinityCore/commit/fd9eb28322fd75e94fcf5093aaf54bee145edfe8)
This commit is contained in:
hondacrx
2022-03-10 10:40:32 -05:00
parent cd29996170
commit a77e6865b2
5 changed files with 9 additions and 9 deletions
+3 -3
View File
@@ -34,11 +34,11 @@ namespace Framework.Constants
public enum PetSaveMode
{
AsDeleted = -1, // not saved in fact
NotInSlot = -1, // for avoid conflict with stable size grow will use negative value
AsDeleted = -2, // not saved in fact
AsCurrent = 0, // in current slot (with player)
FirstStableSlot = 1,
LastStableSlot = 4, // last in DB stable slot index (including), all higher have same meaning as PET_SAVE_NOT_IN_SLOT
NotInSlot = 100 // for avoid conflict with stable size grow will use 100
LastStableSlot = SharedConst.MaxPetStables, // last in DB stable slot index (including), all higher have same meaning as PET_SAVE_NOT_IN_SLOT
}
public enum PetSpellState
@@ -721,7 +721,7 @@ namespace Framework.Database
PrepareStatement(CharStatements.UPD_CHAR_PET_NAME, "UPDATE character_pet SET name = ?, renamed = 1 WHERE owner = ? AND id = ?");
PrepareStatement(CharStatements.UPD_CHAR_PET_SLOT_BY_ID, "UPDATE character_pet SET slot = ? WHERE owner = ? AND id = ?");
PrepareStatement(CharStatements.DEL_CHAR_PET_BY_ID, "DELETE FROM character_pet WHERE id = ?");
PrepareStatement(CharStatements.DEL_CHAR_PET_BY_SLOT, "DELETE FROM character_pet WHERE owner = ? AND (slot = ? OR slot > ?)");
PrepareStatement(CharStatements.DEL_CHAR_PET_BY_SLOT, "DELETE FROM character_pet WHERE owner = ? AND slot IN (?, ?)");
PrepareStatement(CharStatements.DEL_ALL_PET_SPELLS_BY_OWNER, "DELETE FROM pet_spell WHERE guid in (SELECT id FROM character_pet WHERE owner=?)");
PrepareStatement(CharStatements.UPD_PET_SPECS_BY_OWNER, "UPDATE character_pet SET specialization = 0 WHERE owner=?");
PrepareStatement(CharStatements.INS_PET, "INSERT INTO character_pet (id, entry, owner, modelid, level, exp, Reactstate, slot, name, renamed, curhealth, curmana, abdata, savetime, CreatedBySpell, PetType, specialization) " +