mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-05-08 19:57:46 +00:00
fix possible null pointer access & eobj state update
This commit is contained in:
parent
c210b5ebef
commit
4137379853
2 changed files with 14 additions and 2 deletions
|
@ -313,10 +313,13 @@ void Core::Entity::Actor::setCurrentZone( ZonePtr currZone )
|
||||||
m_pCurrentZone = currZone;
|
m_pCurrentZone = currZone;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*! \return InstanceContentPtr to the current instance, null if not an instance or not set */
|
/*! \return InstanceContentPtr to the current instance, nullptr if not an instance or not set */
|
||||||
Core::InstanceContentPtr Core::Entity::Actor::getCurrentInstance() const
|
Core::InstanceContentPtr Core::Entity::Actor::getCurrentInstance() const
|
||||||
{
|
{
|
||||||
return getCurrentZone()->getAsInstanceContent();
|
if( m_pCurrentZone )
|
||||||
|
return m_pCurrentZone->getAsInstanceContent();
|
||||||
|
|
||||||
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
|
|
@ -56,6 +56,15 @@ void Core::Entity::EventObject::setState( uint8_t state )
|
||||||
{
|
{
|
||||||
m_state = state;
|
m_state = state;
|
||||||
|
|
||||||
|
for( const auto& player : m_inRangePlayers )
|
||||||
|
{
|
||||||
|
ZoneChannelPacket< FFXIVIpcActorControl142 > eobjUpdatePacket( getId(), player->getId() );
|
||||||
|
eobjUpdatePacket.data().category = Common::ActorControlType::DirectorEObjMod;
|
||||||
|
eobjUpdatePacket.data().param1 = state;
|
||||||
|
|
||||||
|
player->queuePacket( eobjUpdatePacket );
|
||||||
|
}
|
||||||
|
|
||||||
//m_parentInstance->updateEObj( InstanceObjectPtr( this ) );
|
//m_parentInstance->updateEObj( InstanceObjectPtr( this ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue