1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-04-28 15:17:46 +00:00

Fix logging, Linux

This commit is contained in:
goaaats 2019-01-23 23:50:31 +01:00
parent 25478e3a1c
commit 8da67dd2c5
2 changed files with 10 additions and 18 deletions

View file

@ -228,7 +228,7 @@ bool Sapphire::Entity::BNpc::moveTo( const FFXIVARR_POSITION3& pos )
} }
else else
{ {
Logger::debug( "No path found for target: {0} {1} {2} in ", pos.x, pos.y, pos.z, m_pCurrentZone->getInternalName() ); Logger::debug( "No path found from x{0} y{1} z{2} to x{3} y{4} z{5} in {6}", getPos().x, getPos().y, getPos().z, pos.x, pos.y, pos.z, m_pCurrentZone->getInternalName() );
} }
} }
/* /*

View file

@ -208,20 +208,12 @@ bool Sapphire::NaviProvider::getSteerTarget( dtNavMeshQuery* navQuery, const flo
std::vector< Sapphire::Common::FFXIVARR_POSITION3 > Sapphire::NaviProvider::findFollowPath( Common::FFXIVARR_POSITION3 startPos, Common::FFXIVARR_POSITION3 endPos ) std::vector< Sapphire::Common::FFXIVARR_POSITION3 > Sapphire::NaviProvider::findFollowPath( Common::FFXIVARR_POSITION3 startPos, Common::FFXIVARR_POSITION3 endPos )
{ {
if( !m_naviMesh || !m_naviMeshQuery ) if( !m_naviMesh || !m_naviMeshQuery )
throw std::exception( "No navimesh loaded" ); throw std::runtime_error( "No navimesh loaded" );
auto resultCoords = std::vector< Common::FFXIVARR_POSITION3 >(); auto resultCoords = std::vector< Common::FFXIVARR_POSITION3 >();
dtPolyRef startRef, endRef = 0; dtPolyRef startRef, endRef = 0;
/*
float spos[3];
NaviProvider::toDetourPos( startPos, spos );
float epos[3];
NaviProvider::toDetourPos( endPos, epos );
*/
float spos[3] = {startPos.x, startPos.y, startPos.z}; float spos[3] = {startPos.x, startPos.y, startPos.z};
float epos[3] = {endPos.x, endPos.y, endPos.z}; float epos[3] = {endPos.x, endPos.y, endPos.z};
@ -380,7 +372,7 @@ void Sapphire::NaviProvider::loadMesh( std::string path )
{ {
FILE* fp = fopen( path.c_str(), "rb" ); FILE* fp = fopen( path.c_str(), "rb" );
if( !fp ) if( !fp )
throw std::exception( "Could open navimesh file" ); throw std::runtime_error( "Could open navimesh file" );
// Read header. // Read header.
NavMeshSetHeader header; NavMeshSetHeader header;
@ -389,19 +381,19 @@ void Sapphire::NaviProvider::loadMesh( std::string path )
if( readLen != 1 ) if( readLen != 1 )
{ {
fclose( fp ); fclose( fp );
throw std::exception( "Could not read NavMeshSetHeader" ); throw std::runtime_error( "Could not read NavMeshSetHeader" );
} }
if( header.magic != NAVMESHSET_MAGIC ) if( header.magic != NAVMESHSET_MAGIC )
{ {
fclose( fp ); fclose( fp );
throw std::exception( "Not a NavMeshSet" ); throw std::runtime_error( "Not a NavMeshSet" );
} }
if( header.version != NAVMESHSET_VERSION ) if( header.version != NAVMESHSET_VERSION )
{ {
fclose( fp ); fclose( fp );
throw std::exception( "Invalid NavMeshSet version" ); throw std::runtime_error( "Invalid NavMeshSet version" );
} }
if( !m_naviMesh ) if( !m_naviMesh )
@ -410,14 +402,14 @@ void Sapphire::NaviProvider::loadMesh( std::string path )
if( !m_naviMesh ) if( !m_naviMesh )
{ {
fclose( fp ); fclose( fp );
throw std::exception( "Could not allocate dtNavMesh" ); throw std::runtime_error( "Could not allocate dtNavMesh" );
} }
dtStatus status = m_naviMesh->init( &header.params ); dtStatus status = m_naviMesh->init( &header.params );
if( dtStatusFailed( status ) ) if( dtStatusFailed( status ) )
{ {
fclose( fp ); fclose( fp );
throw std::exception( "Could not initialize dtNavMesh" ); throw std::runtime_error( "Could not initialize dtNavMesh" );
} }
} }
@ -429,7 +421,7 @@ void Sapphire::NaviProvider::loadMesh( std::string path )
if( readLen != 1 ) if( readLen != 1 )
{ {
fclose( fp ); fclose( fp );
throw std::exception( "Could not read NavMeshTileHeader" ); throw std::runtime_error( "Could not read NavMeshTileHeader" );
} }
if( !tileHeader.tileRef || !tileHeader.dataSize ) if( !tileHeader.tileRef || !tileHeader.dataSize )
@ -443,7 +435,7 @@ void Sapphire::NaviProvider::loadMesh( std::string path )
{ {
dtFree( data ); dtFree( data );
fclose( fp ); fclose( fp );
throw std::exception( "Could not read tile data" ); throw std::runtime_error( "Could not read tile data" );
} }
m_naviMesh->addTile( data, tileHeader.dataSize, DT_TILE_FREE_DATA, tileHeader.tileRef, 0 ); m_naviMesh->addTile( data, tileHeader.dataSize, DT_TILE_FREE_DATA, tileHeader.tileRef, 0 );