mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-07-22 19:17:45 +00:00
Deaggro when outranging gets higher priority
This commit is contained in:
parent
cfa81f0df5
commit
b8efc8f8dc
1 changed files with 5 additions and 5 deletions
|
@ -35,6 +35,11 @@ void AI::Fsm::StateCombat::onUpdate( Entity::BNpc& bnpc, uint64_t tickCount )
|
|||
|
||||
auto distance = Common::Util::distance( bnpc.getPos(), pHatedActor->getPos() );
|
||||
|
||||
if( bnpc.hasFlag( Entity::Immobile ) && distance > 30.0f )
|
||||
{
|
||||
bnpc.deaggro( pHatedActor );
|
||||
}
|
||||
|
||||
if( !bnpc.hasFlag( Entity::NoDeaggro ) )
|
||||
{
|
||||
|
||||
|
@ -48,11 +53,6 @@ void AI::Fsm::StateCombat::onUpdate( Entity::BNpc& bnpc, uint64_t tickCount )
|
|||
bnpc.moveTo( *pHatedActor );
|
||||
}
|
||||
|
||||
if (bnpc.hasFlag(Entity::Immobile) && distance > 30.0f )
|
||||
{
|
||||
bnpc.deaggro( pHatedActor );
|
||||
}
|
||||
|
||||
if( pNaviProvider->syncPosToChara( bnpc ) )
|
||||
bnpc.sendPositionUpdate();
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue