mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-30 16:17:46 +00:00
More pathfinding
This commit is contained in:
parent
78a2dc08d0
commit
a1720bd179
3 changed files with 15 additions and 1 deletions
|
@ -315,7 +315,7 @@ void Sapphire::Entity::BNpc::update( int64_t currTime )
|
||||||
{
|
{
|
||||||
const uint8_t minActorDistance = 4;
|
const uint8_t minActorDistance = 4;
|
||||||
const uint8_t aggroRange = 8;
|
const uint8_t aggroRange = 8;
|
||||||
const uint8_t maxDistanceToOrigin = 30;
|
const uint8_t maxDistanceToOrigin = 1000;
|
||||||
|
|
||||||
if( m_status == ActorStatus::Dead )
|
if( m_status == ActorStatus::Dead )
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -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
|
else
|
||||||
{
|
{
|
||||||
player.sendUrgent( "{0} is not a valid SET command.", subCommand );
|
player.sendUrgent( "{0} is not a valid SET command.", subCommand );
|
||||||
|
|
|
@ -280,6 +280,8 @@ std::vector< Sapphire::Common::FFXIVARR_POSITION3 > Sapphire::NaviProvider::find
|
||||||
m_naviMeshQuery->closestPointOnPoly( startRef, spos, iterPos, 0 );
|
m_naviMeshQuery->closestPointOnPoly( startRef, spos, iterPos, 0 );
|
||||||
m_naviMeshQuery->closestPointOnPoly( polys[npolys - 1], epos, targetPos, 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 STEP_SIZE = 0.5f;
|
||||||
static const float SLOP = 0.01f;
|
static const float SLOP = 0.01f;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue