1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-04-30 08:07:46 +00:00

More pathfinding

This commit is contained in:
goaaats 2019-01-21 18:25:22 +01:00
parent 78a2dc08d0
commit a1720bd179
3 changed files with 15 additions and 1 deletions

View file

@ -315,7 +315,7 @@ void Sapphire::Entity::BNpc::update( int64_t currTime )
{
const uint8_t minActorDistance = 4;
const uint8_t aggroRange = 8;
const uint8_t maxDistanceToOrigin = 30;
const uint8_t maxDistanceToOrigin = 1000;
if( m_status == ActorStatus::Dead )
return;

View file

@ -367,6 +367,18 @@ void Sapphire::World::Manager::DebugCommandMgr::set( char* data, Entity::Player&
}
}
}
else if( subCommand == "mobaggro" )
{
auto inRange = player.getInRangeActors();
for( auto actor : inRange )
{
if( actor->getId() == player.getTargetId() && actor->getAsChara()->isAlive() )
{
actor->getAsBNpc()->onActionHostile( player.getAsChara() );
}
}
}
else
{
player.sendUrgent( "{0} is not a valid SET command.", subCommand );

View file

@ -280,6 +280,8 @@ std::vector< Sapphire::Common::FFXIVARR_POSITION3 > Sapphire::NaviProvider::find
m_naviMeshQuery->closestPointOnPoly( startRef, spos, iterPos, 0 );
m_naviMeshQuery->closestPointOnPoly( polys[npolys - 1], epos, targetPos, 0 );
Logger::debug("IterPos: {0} {1} {2}; TargetPos: {3} {4} {5}", iterPos[0], iterPos[1], iterPos[2], targetPos[0], targetPos[1], targetPos[2]);
static const float STEP_SIZE = 0.5f;
static const float SLOP = 0.01f;