1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-04-27 14:57:44 +00:00

Merge pull request #390 from KBiscuit/updates/examine

Examine works correctly again / Handles errors for GM's and diff zones
This commit is contained in:
Mordred 2018-09-24 22:19:23 +02:00 committed by GitHub
commit ae91d39c9b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 26 additions and 11 deletions

View file

@ -200,6 +200,8 @@ enum ActorControlType :
SetCharaGearParamUI = 0x260,
ToggleWireframeRendering = 0x261,
ExamineError = 0x2BF,
GearSetEquipMsg = 0x321,
SetFestival = 0x386, // param1: festival.exd index

View file

@ -53,7 +53,14 @@ void examineHandler( Core::Entity::Player& player, uint32_t targetId )
auto pTarget = pSession->getPlayer();
if( pTarget )
{
player.queuePacket( boost::make_shared< ExaminePacket >( player, pTarget ) );
if( pTarget->isActingAsGm() || pTarget->getZoneId() != player.getZoneId() )
{
player.queuePacket( makeActorControl142( player.getId(), ActorControlType::ExamineError ) );
}
else
{
player.queuePacket( boost::make_shared< ExaminePacket >( player, pTarget ) );
}
}
}
}

View file

@ -120,6 +120,9 @@ void Core::Network::GameConnection::reqExamineSearchCommentHandler( const Core::
if( pPlayer )
{
if( pPlayer->isActingAsGm() || pPlayer->getZoneId() != player.getZoneId() )
return;
// retail sends the requester's id as both (isForSelf)
auto searchInfoPacket = makeZonePacket< FFXIVIpcExamineSearchComment >( player.getId() );
searchInfoPacket->data().charId = targetId;
@ -144,6 +147,9 @@ void Core::Network::GameConnection::reqExamineFcInfo( const Core::Network::Packe
if( pPlayer )
{
if( pPlayer->isActingAsGm() || pPlayer->getZoneId() != player.getZoneId() )
return;
// retail sends the requester's id as both (isForSelf)
auto examineFcInfoPacket = makeZonePacket< FFXIVIpcExamineFreeCompanyInfo >( player.getId() );
examineFcInfoPacket->data().charId = targetId;

View file

@ -50,16 +50,16 @@ private:
memcpy( m_data.look, pTarget->getLookArray(), sizeof( m_data.look ) );
m_data.models[ Common::GearModelSlot::ModelHead ] = player.getModelForSlot( Common::GearModelSlot::ModelHead );
m_data.models[ Common::GearModelSlot::ModelBody ] = player.getModelForSlot( Common::GearModelSlot::ModelBody );
m_data.models[ Common::GearModelSlot::ModelHands ] = player.getModelForSlot( Common::GearModelSlot::ModelHands );
m_data.models[ Common::GearModelSlot::ModelLegs ] = player.getModelForSlot( Common::GearModelSlot::ModelLegs );
m_data.models[ Common::GearModelSlot::ModelFeet ] = player.getModelForSlot( Common::GearModelSlot::ModelFeet );
m_data.models[ Common::GearModelSlot::ModelNeck ] = player.getModelForSlot( Common::GearModelSlot::ModelNeck );
m_data.models[ Common::GearModelSlot::ModelEar ] = player.getModelForSlot( Common::GearModelSlot::ModelEar );
m_data.models[ Common::GearModelSlot::ModelRing1 ] = player.getModelForSlot( Common::GearModelSlot::ModelRing1 );
m_data.models[ Common::GearModelSlot::ModelRing2 ] = player.getModelForSlot( Common::GearModelSlot::ModelRing2 );
m_data.models[ Common::GearModelSlot::ModelWrist ] = player.getModelForSlot( Common::GearModelSlot::ModelWrist );
m_data.models[ Common::GearModelSlot::ModelHead ] = pTarget->getModelForSlot( Common::GearModelSlot::ModelHead );
m_data.models[ Common::GearModelSlot::ModelBody ] = pTarget->getModelForSlot( Common::GearModelSlot::ModelBody );
m_data.models[ Common::GearModelSlot::ModelHands ] = pTarget->getModelForSlot( Common::GearModelSlot::ModelHands );
m_data.models[ Common::GearModelSlot::ModelLegs ] = pTarget->getModelForSlot( Common::GearModelSlot::ModelLegs );
m_data.models[ Common::GearModelSlot::ModelFeet ] = pTarget->getModelForSlot( Common::GearModelSlot::ModelFeet );
m_data.models[ Common::GearModelSlot::ModelNeck ] = pTarget->getModelForSlot( Common::GearModelSlot::ModelNeck );
m_data.models[ Common::GearModelSlot::ModelEar ] = pTarget->getModelForSlot( Common::GearModelSlot::ModelEar );
m_data.models[ Common::GearModelSlot::ModelRing1 ] = pTarget->getModelForSlot( Common::GearModelSlot::ModelRing1 );
m_data.models[ Common::GearModelSlot::ModelRing2 ] = pTarget->getModelForSlot( Common::GearModelSlot::ModelRing2 );
m_data.models[ Common::GearModelSlot::ModelWrist ] = pTarget->getModelForSlot( Common::GearModelSlot::ModelWrist );
// todo: main/sub/other stuff too