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:
parent
12bda0e38e
commit
ccbf6bea61
1 changed files with 5 additions and 6 deletions
|
@ -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() ) )
|
||||
|
|
Loading…
Add table
Reference in a new issue