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

Small bnpc fixed. Target / initial state

This commit is contained in:
Mordred 2019-01-29 23:54:52 +01:00
parent 3a4b472ddd
commit a387f649fa
3 changed files with 9 additions and 10 deletions

View file

@ -92,11 +92,10 @@ TiledNavmeshGenerator::~TiledNavmeshGenerator()
if( m_triareas )
delete[] m_triareas;
if( m_solid )
delete m_solid;
delete m_ctx;
rcFreeContourSet( m_cset );
rcFreeHeightField( m_solid );
rcFreeCompactHeightfield(m_chf);
rcFreePolyMesh( m_pmesh );
rcFreePolyMeshDetail( m_dmesh );

View file

@ -67,12 +67,14 @@ Sapphire::Entity::BNpc::BNpc( uint32_t id, BNpcTemplatePtr pTemplate, float posX
m_rot = rot;
m_level = level;
m_invincibilityType = InvincibilityNone;
m_currentStance = Common::Stance::Passive;
m_pCurrentZone = pZone;
m_spawnPos = m_pos;
m_timeOfDeath = 0;
m_targetId = Common::INVALID_GAME_OBJECT_ID64;
m_maxHp = maxHp;
m_maxMp = 200;

View file

@ -400,11 +400,12 @@ void Sapphire::Zone::updateBNpcs( int64_t tickCount )
if( !pBNpc )
continue;
if( !pBNpc->isAlive() && currTime - pBNpc->getTimeOfDeath() > 10 )
{
removeActor( pBNpc );
break;
}
if( !pBNpc->isAlive() )
if( currTime - pBNpc->getTimeOfDeath() > 10 )
{
removeActor( pBNpc );
break;
}
}
for( uint32_t y = 0; y < _sizeY; ++y )
@ -673,9 +674,6 @@ void Sapphire::Zone::updateInRangeSet( Entity::ActorPtr pActor, Cell* pCell )
pActor->addInRangeActor( pCurAct );
pCurAct->addInRangeActor( pActor );
// this is a hack to limit actor spawn in one packetset
if( count++ > 10 )
break;
}
else if( !isInRange && isInRangeSet )
{