1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-04-26 14:37:44 +00:00
This commit is contained in:
goaaats 2019-01-23 21:36:26 +01:00
parent 54e60107e9
commit 39c1282d6f
3 changed files with 12 additions and 12 deletions

View file

@ -167,14 +167,14 @@ void Sapphire::Entity::BNpc::step()
return; return;
} }
auto stepPos = m_naviLastPath[m_naviPathStep]; auto stepPos = m_naviLastPath[ m_naviPathStep ];
if( Util::distance( getPos().x, getPos().y, getPos().z, stepPos.x, stepPos.y, stepPos.z ) <= 4 && m_naviPathStep < m_naviLastPath.size() - 1 ) if( Util::distance( getPos().x, getPos().y, getPos().z, stepPos.x, stepPos.y, stepPos.z ) <= 4 && m_naviPathStep < m_naviLastPath.size() - 1 )
{ {
// Reached step in path // Reached step in path
m_naviPathStep++; m_naviPathStep++;
stepPos = m_naviLastPath[m_naviPathStep]; stepPos = m_naviLastPath[ m_naviPathStep ];
} }
// This is probably not a good way to do it but works fine for now // This is probably not a good way to do it but works fine for now

View file

@ -23,7 +23,7 @@ bool Sapphire::World::Manager::NaviMgr::setupTerritory( std::string internalName
Sapphire::NaviProvider* Sapphire::World::Manager::NaviMgr::getNaviProvider( std::string internalName ) Sapphire::NaviProvider* Sapphire::World::Manager::NaviMgr::getNaviProvider( std::string internalName )
{ {
if( m_naviProviderTerritoryMap.find( internalName ) != m_naviProviderTerritoryMap.end() ) if( m_naviProviderTerritoryMap.find( internalName ) != m_naviProviderTerritoryMap.end() )
return m_naviProviderTerritoryMap[internalName]; return m_naviProviderTerritoryMap[ internalName ];
return nullptr; return nullptr;
} }

View file

@ -347,7 +347,7 @@ bool Sapphire::World::ServerMgr::createSession( uint32_t sessionId )
Logger::info( "[{0}] Creating new session", session_id_str ); Logger::info( "[{0}] Creating new session", session_id_str );
std::shared_ptr< Session > newSession( new Session( sessionId, framework() ) ); std::shared_ptr< Session > newSession( new Session( sessionId, framework() ) );
m_sessionMapById[sessionId] = newSession; m_sessionMapById[ sessionId ] = newSession;
if( !newSession->loadPlayer() ) if( !newSession->loadPlayer() )
{ {
@ -355,7 +355,7 @@ bool Sapphire::World::ServerMgr::createSession( uint32_t sessionId )
return false; return false;
} }
m_sessionMapByName[newSession->getPlayer()->getName()] = newSession; m_sessionMapByName[ newSession->getPlayer()->getName() ] = newSession;
return true; return true;
@ -424,7 +424,7 @@ std::string Sapphire::World::ServerMgr::getPlayerNameFromDb( uint32_t playerId,
void Sapphire::World::ServerMgr::updatePlayerName( uint32_t playerId, const std::string & playerNewName ) void Sapphire::World::ServerMgr::updatePlayerName( uint32_t playerId, const std::string & playerNewName )
{ {
m_playerNameMapById[playerId] = playerNewName; m_playerNameMapById[ playerId ] = playerNewName;
} }
void Sapphire::World::ServerMgr::loadBNpcTemplates() void Sapphire::World::ServerMgr::loadBNpcTemplates()
@ -455,13 +455,13 @@ void Sapphire::World::ServerMgr::loadBNpcTemplates()
auto look = res->getBlobVector( 12 ); auto look = res->getBlobVector( 12 );
auto models = res->getBlobVector( 13 ); auto models = res->getBlobVector( 13 );
auto bnpcTemplate = std::make_shared< Entity::BNpcTemplate >( auto bnpcTemplate = std::make_shared< Entity::BNpcTemplate >(
id, bNPCBaseId, bNPCNameId, mainWeaponModel, secWeaponModel, id, bNPCBaseId, bNPCNameId, mainWeaponModel, secWeaponModel,
aggressionMode, enemyType, 0, pose, modelChara, displayFlags, aggressionMode, enemyType, 0, pose, modelChara, displayFlags,
reinterpret_cast<uint32_t*>( &models[0] ), reinterpret_cast< uint32_t* >( &models[ 0 ] ),
reinterpret_cast<uint8_t*>( &look[0] ) ); reinterpret_cast< uint8_t* >( &look[ 0 ] ) );
m_bNpcTemplateMap[name] = bnpcTemplate; m_bNpcTemplateMap[ name ] = bnpcTemplate;
} }
Logger::debug( "BNpc Templates loaded: {0}", m_bNpcTemplateMap.size() ); Logger::debug( "BNpc Templates loaded: {0}", m_bNpcTemplateMap.size() );