mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-26 06:27:45 +00:00
ignore aggro range calc if level difference >= 10
This commit is contained in:
parent
166074a559
commit
f3722be358
1 changed files with 5 additions and 5 deletions
|
@ -589,12 +589,12 @@ void Sapphire::Entity::BNpc::checkAggro()
|
|||
if( pClosestChara->getLevel() > m_level )
|
||||
{
|
||||
auto levelDiff = std::abs( pClosestChara->getLevel() - this->getLevel() );
|
||||
range = std::max< float >( 0.f, range - std::pow( 1.53f, levelDiff * 0.6f ) );
|
||||
}
|
||||
|
||||
// level difference too great, ignore player
|
||||
if( range == 0.f )
|
||||
return;
|
||||
if( levelDiff >= 10 )
|
||||
range = 0.f;
|
||||
else
|
||||
range = std::max< float >( 0.f, range - std::pow( 1.53f, levelDiff * 0.6f ) );
|
||||
}
|
||||
|
||||
auto distance = Util::distance( getPos().x, getPos().y, getPos().z,
|
||||
pClosestChara->getPos().x,
|
||||
|
|
Loading…
Add table
Reference in a new issue