mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-12-01 21:12:50 +08:00
Fix various hunter bugs (Amended w/ Nullptr check) (#1389)
* Fixes #1093 (Hunter's stuck in Autoshoot and Can't equip gear) * Fixes #1093 (Hunter's stuck in Autoshoot and Can't equip gear)
This commit is contained in:
@@ -83,12 +83,14 @@ bool DropTargetAction::Execute(Event event)
|
|||||||
bot->SetTarget(ObjectGuid::Empty);
|
bot->SetTarget(ObjectGuid::Empty);
|
||||||
bot->SetSelection(ObjectGuid());
|
bot->SetSelection(ObjectGuid());
|
||||||
botAI->ChangeEngine(BOT_STATE_NON_COMBAT);
|
botAI->ChangeEngine(BOT_STATE_NON_COMBAT);
|
||||||
if (bot->getClass() == CLASS_HUNTER &&
|
if (bot->getClass() == CLASS_HUNTER) // Check for Hunter Class
|
||||||
(bot->GetCurrentSpell(CURRENT_AUTOREPEAT_SPELL)->m_spellInfo->Id == 75))
|
{
|
||||||
//Is bot a hunter and is Auto Shot Active?
|
Spell const* spell = bot->GetCurrentSpell(CURRENT_AUTOREPEAT_SPELL); // Get the current spell being cast by the bot
|
||||||
|
if (spell && spell->m_spellInfo->Id == 75) //Check spell is not nullptr before accessing m_spellInfo
|
||||||
{
|
{
|
||||||
bot->InterruptSpell(CURRENT_AUTOREPEAT_SPELL); // Interrupt Auto Shot
|
bot->InterruptSpell(CURRENT_AUTOREPEAT_SPELL); // Interrupt Auto Shot
|
||||||
}
|
}
|
||||||
|
}
|
||||||
bot->AttackStop();
|
bot->AttackStop();
|
||||||
|
|
||||||
// if (Pet* pet = bot->GetPet())
|
// if (Pet* pet = bot->GetPet())
|
||||||
|
|||||||
Reference in New Issue
Block a user