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:
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 )
|
if( pClosestChara->getLevel() > m_level )
|
||||||
{
|
{
|
||||||
auto levelDiff = std::abs( pClosestChara->getLevel() - this->getLevel() );
|
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( levelDiff >= 10 )
|
||||||
if( range == 0.f )
|
range = 0.f;
|
||||||
return;
|
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,
|
auto distance = Util::distance( getPos().x, getPos().y, getPos().z,
|
||||||
pClosestChara->getPos().x,
|
pClosestChara->getPos().x,
|
||||||
|
|
Loading…
Add table
Reference in a new issue