mirror of
https://github.com/liyunfan1223/mod-playerbots.git
synced 2026-02-20 18:10:02 +01:00
Merge branch 'master' into more-av-fixes
This commit is contained in:
commit
ac4d14abd4
@ -1535,6 +1535,9 @@ bool AvoidAoeAction::AvoidAuraWithDynamicObj()
|
|||||||
if (!aura || aura->IsRemoved() || aura->IsExpired()) {
|
if (!aura || aura->IsRemoved() || aura->IsExpired()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if (!aura->GetOwner() || !aura->GetOwner()->IsInWorld()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
// Crash fix: maybe change owner due to check interval
|
// Crash fix: maybe change owner due to check interval
|
||||||
if (aura->GetType() != DYNOBJ_AURA_TYPE) {
|
if (aura->GetType() != DYNOBJ_AURA_TYPE) {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@ -13,7 +13,6 @@ bool StayActionBase::Stay()
|
|||||||
|
|
||||||
//if (!urand(0, 10))
|
//if (!urand(0, 10))
|
||||||
//botAI->PlaySound(TEXT_EMOTE_YAWN);
|
//botAI->PlaySound(TEXT_EMOTE_YAWN);
|
||||||
|
|
||||||
if (bot->GetMotionMaster()->GetCurrentMovementGeneratorType() == FLIGHT_MOTION_TYPE)
|
if (bot->GetMotionMaster()->GetCurrentMovementGeneratorType() == FLIGHT_MOTION_TYPE)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@ -26,12 +25,13 @@ bool StayActionBase::Stay()
|
|||||||
context->GetValue<time_t>("stay time")->Set(stayTime);
|
context->GetValue<time_t>("stay time")->Set(stayTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!bot->isMoving())
|
// Stop the bot from moving immediately when action is called
|
||||||
return false;
|
if (bot->isMoving())
|
||||||
|
{
|
||||||
bot->StopMoving();
|
bot->StopMoving();
|
||||||
bot->ClearUnitState(UNIT_STATE_CHASE);
|
bot->ClearUnitState(UNIT_STATE_CHASE);
|
||||||
bot->ClearUnitState(UNIT_STATE_FOLLOW);
|
bot->ClearUnitState(UNIT_STATE_FOLLOW);
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -43,7 +43,8 @@ bool StayAction::Execute(Event event)
|
|||||||
|
|
||||||
bool StayAction::isUseful()
|
bool StayAction::isUseful()
|
||||||
{
|
{
|
||||||
return !AI_VALUE2(bool, "moving", "self target");
|
// Only useful if the bot is currently moving
|
||||||
|
return AI_VALUE2(bool, "moving", "self target");
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SitAction::Execute(Event event)
|
bool SitAction::Execute(Event event)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user