mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-11-29 15:58:20 +08:00
Fix hunter bot losing dismissed pet during maintenance (#1286)
* Prevents recreating the tamed pet in InitPet() for hunter bots This update adds a check to prevent the InitPet() method from re-creating a pet for hunter bots that already have a tamed pet (GetPetId() != 0). This prevents pets that have already been trained and have talents set from being lost, especially after login or teleportation. Responsibility for re-summoning an existing pet can be handled separately via LoadPetFromDB. * Including check at start to avoid creating a new pet if the bot already has one active or saved in the stable (CurrentPet). Initial check to avoid pet re-creation. Selection of tamable creatures appropriate to the bot's level. Creation, configuration and saving of the pet. Application of visual effects and initialization of talents. Activation of autocast for non-passive spells. * Fix * .
This commit is contained in:
@@ -813,6 +813,10 @@ void PlayerbotFactory::InitPetTalents()
|
||||
void PlayerbotFactory::InitPet()
|
||||
{
|
||||
Pet* pet = bot->GetPet();
|
||||
|
||||
if (!pet && bot->GetPetStable() && bot->GetPetStable()->CurrentPet)
|
||||
return;
|
||||
|
||||
if (!pet)
|
||||
{
|
||||
if (bot->getClass() != CLASS_HUNTER || bot->GetLevel() < 10)
|
||||
|
||||
Reference in New Issue
Block a user