1
Fork 0
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:
Kooper 2025-07-19 20:57:08 +02:00
parent cfa81f0df5
commit b8efc8f8dc

View file

@ -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();