mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-28 15:17:46 +00:00
Do not crash on zones without navi data
This commit is contained in:
parent
0c1cef8050
commit
f8d4b4f9c0
1 changed files with 7 additions and 0 deletions
|
@ -386,6 +386,13 @@ void Sapphire::Entity::BNpc::update( int64_t currTime )
|
|||
{
|
||||
auto pNaviMgr = m_pFw->get< World::Manager::NaviMgr >();
|
||||
auto pNaviProvider = pNaviMgr->getNaviProvider( m_pCurrentZone->getBgPath() );
|
||||
|
||||
if( !pNaviProvider )
|
||||
{
|
||||
m_lastRoamTargetReached = Util::getTimeSeconds();
|
||||
break;
|
||||
}
|
||||
|
||||
m_roamPos = pNaviProvider->findRandomPositionInCircle( m_spawnPos, 5 );
|
||||
m_state = BNpcState::Roaming;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue