mirror of
https://github.com/liyunfan1223/mod-playerbots.git
synced 2026-02-20 18:10:02 +01:00
Changes requested
I fixed what was requested of me. Built it, tested it - all functions are working.
This commit is contained in:
parent
683c6e39e4
commit
ab345b8847
@ -156,9 +156,6 @@ bool PetAttackAction::Execute(Event event)
|
|||||||
|
|
||||||
bool SetPetStanceAction::Execute(Event /*event*/)
|
bool SetPetStanceAction::Execute(Event /*event*/)
|
||||||
{
|
{
|
||||||
// Get the bot player object from the AI
|
|
||||||
Player* bot = botAI->GetBot();
|
|
||||||
|
|
||||||
// Prepare a list to hold all controlled pet and guardian creatures
|
// Prepare a list to hold all controlled pet and guardian creatures
|
||||||
std::vector<Creature*> targets;
|
std::vector<Creature*> targets;
|
||||||
|
|
||||||
|
|||||||
@ -108,7 +108,7 @@ bool TameAction::Execute(Event event)
|
|||||||
// Handle "tame abandon" command to give up your current pet
|
// Handle "tame abandon" command to give up your current pet
|
||||||
if (mode == "abandon")
|
if (mode == "abandon")
|
||||||
{
|
{
|
||||||
return abandonPet();
|
return AbandonPet();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Try to process the command based on mode and value
|
// Try to process the command based on mode and value
|
||||||
@ -476,7 +476,7 @@ bool TameAction::CreateAndSetPet(uint32 creatureEntry)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TameAction::abandonPet()
|
bool TameAction::AbandonPet()
|
||||||
{
|
{
|
||||||
// Get the bot player and its current pet (if any)
|
// Get the bot player and its current pet (if any)
|
||||||
Player* bot = botAI->GetBot();
|
Player* bot = botAI->GetBot();
|
||||||
|
|||||||
@ -25,7 +25,7 @@ private:
|
|||||||
bool SetPetByFamily(const std::string& family);
|
bool SetPetByFamily(const std::string& family);
|
||||||
bool RenamePet(const std::string& newName);
|
bool RenamePet(const std::string& newName);
|
||||||
bool CreateAndSetPet(uint32 creatureEntry);
|
bool CreateAndSetPet(uint32 creatureEntry);
|
||||||
bool abandonPet();
|
bool AbandonPet();
|
||||||
|
|
||||||
std::string lastPetName;
|
std::string lastPetName;
|
||||||
uint32 lastPetId = 0;
|
uint32 lastPetId = 0;
|
||||||
|
|||||||
@ -692,9 +692,11 @@ bool NewPetTrigger::IsActive()
|
|||||||
{
|
{
|
||||||
// Get the bot player object from the AI
|
// Get the bot player object from the AI
|
||||||
Player* bot = botAI->GetBot();
|
Player* bot = botAI->GetBot();
|
||||||
|
if (!bot)
|
||||||
|
return false;
|
||||||
|
|
||||||
// Try to get the current pet; initialize guardian and GUID to null/empty
|
// Try to get the current pet; initialize guardian and GUID to null/empty
|
||||||
Pet* pet = bot ? bot->GetPet() : nullptr;
|
Pet* pet = bot->GetPet();
|
||||||
Guardian* guardian = nullptr;
|
Guardian* guardian = nullptr;
|
||||||
ObjectGuid currentPetGuid = ObjectGuid::Empty;
|
ObjectGuid currentPetGuid = ObjectGuid::Empty;
|
||||||
|
|
||||||
@ -706,7 +708,7 @@ bool NewPetTrigger::IsActive()
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// If no pet, try to get a guardian pet and its GUID
|
// If no pet, try to get a guardian pet and its GUID
|
||||||
guardian = bot ? bot->GetGuardianPet() : nullptr;
|
guardian = bot->GetGuardianPet();
|
||||||
if (guardian)
|
if (guardian)
|
||||||
currentPetGuid = guardian->GetGUID();
|
currentPetGuid = guardian->GetGUID();
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user