mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-17 02:50:29 +00:00
fix(Core/Hunter): Stable Master, exotics pets management, tame validations. (#2100)
This commit is contained in:
@@ -20815,7 +20815,10 @@ void Player::RemovePet(Pet* pet, PetSaveMode mode, bool returnreagent)
|
||||
{
|
||||
// xinef: dont save dead pet as current, save him not in slot
|
||||
if (!pet->IsAlive() && mode == PET_SAVE_AS_CURRENT && pet->getPetType() == HUNTER_PET)
|
||||
{
|
||||
mode = PET_SAVE_NOT_IN_SLOT;
|
||||
m_temporaryUnsummonedPetNumber = 0;
|
||||
}
|
||||
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
sLog->outDebug(LOG_FILTER_PETS, "RemovePet %u, %u, %u", pet->GetEntry(), mode, returnreagent);
|
||||
@@ -27579,3 +27582,19 @@ void Player::SummonPet(uint32 entry, float x, float y, float z, float ang, PetTy
|
||||
AsynchPetSummon* asynchPetInfo = new AsynchPetSummon(entry, pos, petType, duration, createdBySpell, casterGUID);
|
||||
Pet::LoadPetFromDB(this, asynchLoadType, entry, 0, false, asynchPetInfo);
|
||||
}
|
||||
|
||||
bool Player::IsPetDismissed()
|
||||
{
|
||||
/*
|
||||
* Check PET_SAVE_NOT_IN_SLOT means the pet is dismissed. If someone ever
|
||||
* Changes the slot flag, they will break this validation.
|
||||
*/
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_PET_BY_ENTRY_AND_SLOT);
|
||||
stmt->setUInt32(0, GetGUIDLow());
|
||||
stmt->setUInt8(1, uint8(PET_SAVE_NOT_IN_SLOT));
|
||||
|
||||
if (PreparedQueryResult result = CharacterDatabase.AsyncQuery(stmt))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user