mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-11-29 15:58:20 +08:00
Fix mount bug after bot logout
This commit is contained in:
@@ -497,6 +497,7 @@ void PlayerbotAI::Reset(bool full)
|
||||
}
|
||||
|
||||
currentEngine = engines[BOT_STATE_NON_COMBAT];
|
||||
currentState = BOT_STATE_NON_COMBAT;
|
||||
nextAICheckDelay = 0;
|
||||
whispers.clear();
|
||||
|
||||
@@ -1166,18 +1167,25 @@ void PlayerbotAI::DoNextAction(bool min)
|
||||
else if ((nextAICheckDelay < 1000) && bot->IsSitState())
|
||||
bot->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
|
||||
if (bot->IsFlying() && !!bot->HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED) && !bot->HasAuraType(SPELL_AURA_FLY))
|
||||
bool hasMountAura = bot->HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_SPEED) || bot->HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED);
|
||||
if (hasMountAura && !bot->IsMounted())
|
||||
{
|
||||
if (bot->m_movementInfo.HasMovementFlag(MOVEMENTFLAG_FLYING))
|
||||
bot->m_movementInfo.RemoveMovementFlag(MOVEMENTFLAG_FLYING);
|
||||
|
||||
if (bot->m_movementInfo.HasMovementFlag(MOVEMENTFLAG_CAN_FLY))
|
||||
bot->m_movementInfo.RemoveMovementFlag(MOVEMENTFLAG_CAN_FLY);
|
||||
|
||||
if (bot->m_movementInfo.HasMovementFlag(MOVEMENTFLAG_DISABLE_GRAVITY))
|
||||
bot->m_movementInfo.RemoveMovementFlag(MOVEMENTFLAG_DISABLE_GRAVITY);
|
||||
bot->RemoveAurasByType(SPELL_AURA_MOD_INCREASE_MOUNTED_SPEED);
|
||||
bot->RemoveAurasByType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED);
|
||||
}
|
||||
|
||||
// if (bot->IsFlying() && !bot->HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED) && !bot->HasAuraType(SPELL_AURA_FLY))
|
||||
// {
|
||||
// if (bot->m_movementInfo.HasMovementFlag(MOVEMENTFLAG_FLYING))
|
||||
// bot->m_movementInfo.RemoveMovementFlag(MOVEMENTFLAG_FLYING);
|
||||
|
||||
// if (bot->m_movementInfo.HasMovementFlag(MOVEMENTFLAG_CAN_FLY))
|
||||
// bot->m_movementInfo.RemoveMovementFlag(MOVEMENTFLAG_CAN_FLY);
|
||||
|
||||
// if (bot->m_movementInfo.HasMovementFlag(MOVEMENTFLAG_DISABLE_GRAVITY))
|
||||
// bot->m_movementInfo.RemoveMovementFlag(MOVEMENTFLAG_DISABLE_GRAVITY);
|
||||
// }
|
||||
|
||||
/*
|
||||
// land after kncokback/jump
|
||||
if (bot->m_movementInfo.HasMovementFlag(MOVEMENTFLAG_FALLING))
|
||||
|
||||
Reference in New Issue
Block a user