mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-11-29 15:58:20 +08:00
Merge branch 'liyunfan1223:master' into Tame-Chat-Action-/-Pet-Chat-Action-(stances/commands)
This commit is contained in:
@@ -207,7 +207,11 @@ bool WrongPetTrigger::IsActive()
|
|||||||
if (enabledCount != 1)
|
if (enabledCount != 1)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// Step 3: At this point, we know only one pet strategy is enabled.
|
// Step 3: If there is no pet, do not trigger.
|
||||||
|
if (!pet)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// Step 4: At this point, we know only one pet strategy is enabled.
|
||||||
// We check if the currently summoned pet matches the enabled strategy.
|
// We check if the currently summoned pet matches the enabled strategy.
|
||||||
bool correctPet = false;
|
bool correctPet = false;
|
||||||
if (pet)
|
if (pet)
|
||||||
@@ -218,16 +222,16 @@ bool WrongPetTrigger::IsActive()
|
|||||||
correctPet = true;
|
correctPet = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Step 4: If the correct pet is already summoned, the trigger should not activate.
|
// Step 5: If the correct pet is already summoned, the trigger should not activate.
|
||||||
if (correctPet)
|
if (correctPet)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// Step 5: Finally, check if the bot actually knows the spell to summon the desired pet.
|
// Step 6: Finally, check if the bot actually knows the spell to summon the desired pet.
|
||||||
// If so, the trigger is active (bot should summon the correct pet).
|
// If so, the trigger is active (bot should summon the correct pet).
|
||||||
if (bot->HasSpell(enabledPet->spellId))
|
if (bot->HasSpell(enabledPet->spellId))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
// Step 6: If we get here, the bot doesn't know the spell required to support the active pet strategy
|
// Step 7: If we get here, the bot doesn't know the spell required to support the active pet strategy
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user