mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-05-04 17:57:47 +00:00
fix item splitting
This commit is contained in:
parent
1a95399a7e
commit
0a0dcf59ae
3 changed files with 16 additions and 10 deletions
|
@ -153,9 +153,7 @@ struct FFXIVIpcInventoryModifyHandler : FFXIVIpcBasePacket< InventoryModifyHandl
|
|||
{
|
||||
/* 0000 */ uint32_t seq;
|
||||
/* 0004 */ Common::InventoryOperation action;
|
||||
/* 0005 */ char pad_0005[3];
|
||||
/* 0008 */ uint16_t splitCount; // todo: check packet handler in game and see if this is sent as a u16 or u32
|
||||
/* 000A */ char pad_000A[2];
|
||||
/* 0005 */ char pad_0005[7];
|
||||
/* 000C */ uint16_t fromContainer;
|
||||
/* 000E */ char pad_000E[2];
|
||||
/* 0010 */ uint8_t fromSlot;
|
||||
|
@ -163,6 +161,8 @@ struct FFXIVIpcInventoryModifyHandler : FFXIVIpcBasePacket< InventoryModifyHandl
|
|||
/* 0020 */ uint16_t toContainer;
|
||||
/* 0022 */ char pad_0022[2];
|
||||
/* 0024 */ uint8_t toSlot;
|
||||
/* 0025 */ uint8_t pad_0025[3];
|
||||
/* 0028 */ uint32_t splitCount;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -533,16 +533,19 @@ int16_t Core::Entity::Player::addItem( uint16_t inventoryId, int8_t slotId, uint
|
|||
" WHERE storageId = " + std::to_string( inventoryId ) +
|
||||
" AND CharacterId = " + std::to_string( getId() ) );
|
||||
|
||||
if( !slient )
|
||||
{
|
||||
auto invUpdate = boost::make_shared< UpdateInventorySlotPacket >( getId(),
|
||||
rSlotId,
|
||||
inventoryId,
|
||||
*item );
|
||||
|
||||
auto invUpdate = boost::make_shared< UpdateInventorySlotPacket >( getId(),
|
||||
rSlotId,
|
||||
inventoryId,
|
||||
*item );
|
||||
queuePacket( invUpdate );
|
||||
queuePacket( invUpdate );
|
||||
|
||||
if( !silent )
|
||||
queuePacket( boost::make_shared< ActorControlPacket143 >( getId(), ItemObtainIcon,
|
||||
catalogId, item->getStackSize() ) );
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@ -613,6 +616,9 @@ bool Core::Entity::Player::updateContainer( uint16_t storageId, uint8_t slotId,
|
|||
void Core::Entity::Player::splitItem( uint16_t fromInventoryId, uint8_t fromSlotId,
|
||||
uint16_t toInventoryId, uint8_t toSlot, uint16_t itemCount )
|
||||
{
|
||||
if( itemCount == 0 )
|
||||
return;
|
||||
|
||||
auto fromItem = m_storageMap[fromInventoryId]->getItem( fromSlotId );
|
||||
if( !fromItem )
|
||||
return;
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#include <string>
|
||||
#include <typeinfo>
|
||||
#include <typeindex>
|
||||
#include <sapphire_zone/Event/EventHandler.h>
|
||||
#include <Event/EventHandler.h>
|
||||
#include "Forwards.h"
|
||||
|
||||
#ifdef _MSC_VER
|
||||
|
|
Loading…
Add table
Reference in a new issue