1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-04-24 21:57:44 +00:00

Maybe better scales?

This commit is contained in:
Mordred 2019-04-20 15:42:48 +02:00
parent 88f996e183
commit d934863673
3 changed files with 6 additions and 9 deletions

View file

@ -278,7 +278,7 @@ bool Sapphire::Entity::BNpc::moveTo( const Entity::Chara& targetChara )
auto pos1 = pNaviProvider->getMovePos( *this );
if( Util::distance( pos1, targetChara.getPos() ) <= ( getScale() + targetChara.getScale() ) )
if( Util::distance( pos1, targetChara.getPos() ) <= ( getScale() + targetChara.getScale() ) + 0.25f )
{
// Reached destination
face( targetChara.getPos() );
@ -534,9 +534,7 @@ void Sapphire::Entity::BNpc::update( uint64_t tickCount )
return;
auto distanceOrig = Util::distance( getPos().x, getPos().y, getPos().z,
m_spawnPos.x,
m_spawnPos.y,
m_spawnPos.z );
m_spawnPos.x, m_spawnPos.y, m_spawnPos.z );
if( pHatedActor && !pHatedActor->isAlive() )
{
@ -550,9 +548,7 @@ void Sapphire::Entity::BNpc::update( uint64_t tickCount )
if( pHatedActor )
{
auto distance = Util::distance( getPos().x, getPos().y, getPos().z,
pHatedActor->getPos().x,
pHatedActor->getPos().y,
pHatedActor->getPos().z );
pHatedActor->getPos().x, pHatedActor->getPos().y, pHatedActor->getPos().z );
if( !hasFlag( NoDeaggro ) && ( distanceOrig > maxDistanceToOrigin ) )
{
@ -564,7 +560,7 @@ void Sapphire::Entity::BNpc::update( uint64_t tickCount )
break;
}
if( distance > ( getScale() / 2 + pHatedActor->getScale() / 2 ) )
if( distance > ( getScale() + pHatedActor->getScale() ) )
{
if( hasFlag( Immobile ) )
break;

View file

@ -84,6 +84,7 @@ Sapphire::Entity::Player::Player( FrameworkPtr pFw ) :
m_queuedZoneing = nullptr;
m_status = ActorStatus::Idle;
m_invincibilityType = InvincibilityType::InvincibilityNone;
m_scale = 1.f;
memset( m_questTracking, 0, sizeof( m_questTracking ) );
memset( m_name, 0, sizeof( m_name ) );

View file

@ -573,7 +573,7 @@ int32_t Sapphire::World::Navi::NaviProvider::addAgent( Entity::Chara& chara )
params.height = 3.f;
params.maxAcceleration = 25.f;
params.maxSpeed = std::pow( 2, chara.getScale() * 0.35f ) + 1.f;
params.radius = chara.getScale() / 2;
params.radius = ( chara.getScale() ) * 0.9f;
params.collisionQueryRange = params.radius * 12.0f;
params.pathOptimizationRange = params.radius * 20.0f;
params.updateFlags = 0;