1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-04-26 14:37:44 +00:00

ignore aggro range calc if level difference >= 10

This commit is contained in:
NotAdam 2019-01-31 21:45:46 +11:00
parent 166074a559
commit f3722be358

View file

@ -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,