mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-28 15:17:46 +00:00
ignore aggro range calc if level difference >= 10
This commit is contained in:
parent
085a184ad3
commit
b019a1a0c1
1 changed files with 5 additions and 5 deletions
|
@ -589,13 +589,13 @@ void Sapphire::Entity::BNpc::checkAggro()
|
|||
if( pClosestChara->getLevel() > m_level )
|
||||
{
|
||||
auto levelDiff = std::abs( pClosestChara->getLevel() - this->getLevel() );
|
||||
|
||||
if( levelDiff >= 10 )
|
||||
range = 0.f;
|
||||
else
|
||||
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;
|
||||
|
||||
auto distance = Util::distance( getPos().x, getPos().y, getPos().z,
|
||||
pClosestChara->getPos().x,
|
||||
pClosestChara->getPos().y,
|
||||
|
|
Loading…
Add table
Reference in a new issue