mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-24 21:57:44 +00:00
fix issue where yard items couldn't be moved properly
This commit is contained in:
parent
33bd3a7ad6
commit
c86371ac56
4 changed files with 16 additions and 5 deletions
|
@ -215,6 +215,11 @@ enum ActorControlType : uint16_t
|
|||
ShowBuildPresetUI = 0x3E9,
|
||||
BuildPresetResponse = 0x3ED,
|
||||
|
||||
/*!
|
||||
* param1 = object array index
|
||||
*/
|
||||
RemoveExteriorHousingItem = 0x3EF,
|
||||
|
||||
/*!
|
||||
* param1 = object array index
|
||||
*/
|
||||
|
|
|
@ -1260,10 +1260,10 @@ bool Sapphire::World::Manager::HousingMgr::moveExternalItem( Entity::Player& pla
|
|||
auto invMgr = g_fw.get< InventoryMgr >();
|
||||
invMgr->updateHousingItemPosition( item );
|
||||
|
||||
terri.updateYardObjectPos( slot, ident.landId, *item );
|
||||
terri.updateYardObjectPos( player, slot, ident.landId, *item );
|
||||
|
||||
// todo: something is sent to the player here to indicate the move has finished successfully
|
||||
// currently they can move one item and then can't move any more
|
||||
uint32_t param1 = ( ident.landId << 16 ) | InventoryType::HousingExteriorPlacedItems;
|
||||
player.queuePacket( Server::makeActorControl143( player.getId(), ActorControl::HousingItemMoveConfirm, param1, slot ) );
|
||||
|
||||
|
||||
return true;
|
||||
|
|
|
@ -374,7 +374,8 @@ void Sapphire::HousingZone::spawnYardObject( uint8_t landId, uint16_t slotId, In
|
|||
}
|
||||
}
|
||||
|
||||
void Sapphire::HousingZone::updateYardObjectPos( uint16_t slot, uint16_t landId, Inventory::HousingItem& item )
|
||||
void Sapphire::HousingZone::updateYardObjectPos( Entity::Player& sourcePlayer, uint16_t slot, uint16_t landId,
|
||||
Inventory::HousingItem& item )
|
||||
{
|
||||
auto bounds = m_yardObjectArrayBounds[ landId ];
|
||||
auto offset = bounds.first + slot;
|
||||
|
@ -387,6 +388,10 @@ void Sapphire::HousingZone::updateYardObjectPos( uint16_t slot, uint16_t landId,
|
|||
|
||||
for( const auto& player : m_playerMap )
|
||||
{
|
||||
// don't send it from the origin player, it already has the position from the move request
|
||||
if( player.second->getId() == sourcePlayer.getId() )
|
||||
continue;
|
||||
|
||||
auto packet = makeZonePacket< Server::FFXIVIpcYardObjectMove >( player.second->getId() );
|
||||
|
||||
packet->data().itemRotation = item.getRot();
|
||||
|
|
|
@ -56,7 +56,8 @@ namespace Sapphire
|
|||
|
||||
void updateYardObjects( Common::LandIdent ident );
|
||||
void spawnYardObject( uint8_t landId, uint16_t slotId, Sapphire::Inventory::HousingItem& item );
|
||||
void updateYardObjectPos( uint16_t slot, uint16_t landId, Inventory::HousingItem& item );
|
||||
void updateYardObjectPos( Entity::Player& sourcePlayer, uint16_t slot, uint16_t landId,
|
||||
Inventory::HousingItem& item );
|
||||
|
||||
private:
|
||||
using LandPtrMap = std::unordered_map< uint8_t, Sapphire::LandPtr >;
|
||||
|
|
Loading…
Add table
Reference in a new issue