From 5839d12980e8127363aa8afa6d841b7a257831b1 Mon Sep 17 00:00:00 2001 From: Mordred Date: Sat, 28 Jan 2023 23:27:36 +0100 Subject: [PATCH] Placing of yard and interior items works... until you rezone... --- src/world/Inventory/Item.cpp | 2 +- src/world/Network/Handlers/HousingPacketHandlers.cpp | 6 ++++++ src/world/Network/Handlers/PacketCommandHandler.cpp | 2 +- src/world/Territory/House.h | 6 +----- src/world/Territory/HousingZone.cpp | 4 ++-- 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/world/Inventory/Item.cpp b/src/world/Inventory/Item.cpp index 483b510e..b68ce33f 100644 --- a/src/world/Inventory/Item.cpp +++ b/src/world/Inventory/Item.cpp @@ -29,7 +29,7 @@ Sapphire::Item::Item( uint64_t uId, uint32_t catalogId, bool isHq ) : m_itemLevel = itemInfo->data().Level; m_maxStackSize = itemInfo->data().StackMax; // EXD TODO: Not sure what this maps to - //m_additionalData = itemInfo->additionalData; + m_additionalData = itemInfo->data().CategoryArg; m_blockRate = itemInfo->data().ShieldBlockRate; m_block = itemInfo->data().ShieldRate; m_defense = itemInfo->data().Defense; diff --git a/src/world/Network/Handlers/HousingPacketHandlers.cpp b/src/world/Network/Handlers/HousingPacketHandlers.cpp index a1aae987..d8f6d566 100644 --- a/src/world/Network/Handlers/HousingPacketHandlers.cpp +++ b/src/world/Network/Handlers/HousingPacketHandlers.cpp @@ -99,6 +99,12 @@ void Sapphire::Network::GameConnection::reqPlaceHousingItem( const Packets::FFXI const auto packet = ZoneChannelPacket< Client::FFXIVIpcHousingPlaceYardItem >( inPacket ); const auto& data = packet.data(); + Logger::debug( + "Dump:\n{0}", + Util::binaryToHexDump( const_cast< uint8_t* >( &inPacket.data[ 0 ] ), + static_cast< uint16_t >( inPacket.segHdr.size - 0x10 ) ) + ); + if( data.UserData == 1 ) { housingMgr.reqPlaceHousingItem( player, data.landIdOrIndex.landId, data.StorageId, static_cast< uint8_t >( data.ContainerIndex ), diff --git a/src/world/Network/Handlers/PacketCommandHandler.cpp b/src/world/Network/Handlers/PacketCommandHandler.cpp index ee1d7991..e72a5d4c 100644 --- a/src/world/Network/Handlers/PacketCommandHandler.cpp +++ b/src/world/Network/Handlers/PacketCommandHandler.cpp @@ -736,7 +736,7 @@ void Sapphire::Network::GameConnection::commandHandler( const Packets::FFXIVARR_ break; }*/ - case PacketCommand::HOUSING_LAYOUTMODE: + case PacketCommand::HOUSING_WARP_TO_SAFE: { // close ui if( param11 == 1 ) diff --git a/src/world/Territory/House.h b/src/world/Territory/House.h index 186aea9f..32360cca 100644 --- a/src/world/Territory/House.h +++ b/src/world/Territory/House.h @@ -1,6 +1,4 @@ -#ifndef SAPPHIRE_HOUSE_H -#define SAPPHIRE_HOUSE_H - +#pragma once #include "Forwards.h" #include #include @@ -62,5 +60,3 @@ namespace Sapphire }; } - -#endif // SAPPHIRE_HOUSE_H diff --git a/src/world/Territory/HousingZone.cpp b/src/world/Territory/HousingZone.cpp index 3c5f72e0..20a42cfa 100644 --- a/src/world/Territory/HousingZone.cpp +++ b/src/world/Territory/HousingZone.cpp @@ -176,7 +176,7 @@ void Sapphire::HousingZone::onPlayerZoneIn( Entity::Player& player ) auto& objects = m_yardObjects[ isInSubdivision ? 1 : 0 ]; - memcpy( &housingObjectInit->data().YardObjects, &objects + ( yardPacketNum * 400 ), yardObjectSize * 400 ); + memcpy( &housingObjectInit->data().YardObjects, &objects + ( yardPacketNum * 100 ), yardObjectSize * 100 ); server.queueForPlayer( player.getCharacterId(), housingObjectInit ); } @@ -269,7 +269,7 @@ void Sapphire::HousingZone::sendLandUpdate( uint8_t landId ) void Sapphire::HousingZone::onUpdate( uint64_t tickCount ) { - for( auto pLandItr : m_landPtrMap ) + for( const auto& pLandItr : m_landPtrMap ) { pLandItr.second->update( tickCount ); }