1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-07-22 19:17:45 +00:00

Immobile BNpcs don't deaggro anymore when having the "NoDeaggro" flag

This commit is contained in:
Kooper 2025-07-21 19:58:30 +02:00
parent 12bda0e38e
commit ccbf6bea61

View file

@ -35,14 +35,13 @@ 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 );
}
// All possibilities to automatically lose aggro go here
if( !bnpc.hasFlag( Entity::NoDeaggro ) )
{
if( bnpc.hasFlag( Entity::Immobile ) && distance > 30.0f )
{
bnpc.deaggro( pHatedActor );
}
}
if( !bnpc.hasFlag( Entity::Immobile ) && distance > ( bnpc.getNaviTargetReachedDistance() + pHatedActor->getRadius() ) )