diff --git a/src/world/Actor/Player.cpp b/src/world/Actor/Player.cpp index 5eee8372..e98f8008 100644 --- a/src/world/Actor/Player.cpp +++ b/src/world/Actor/Player.cpp @@ -1926,7 +1926,7 @@ uint8_t Sapphire::Entity::Player::getNextObjSpawnIndexForActorId( uint32_t actor return index; } -void Sapphire::Entity::Player::setDyeingInfo( uint32_t itemToDyeContainer, uint32_t itemToDyeSlot, uint32_t dyeBagContainer, uint32_t dyeBagSlot) +void Sapphire::Entity::Player::setDyeingInfo( uint32_t itemToDyeContainer, uint32_t itemToDyeSlot, uint32_t dyeBagContainer, uint32_t dyeBagSlot ) { m_dyeingInfo.itemToDyeContainer = itemToDyeContainer; m_dyeingInfo.itemToDyeSlot = itemToDyeSlot; @@ -1942,18 +1942,18 @@ void Sapphire::Entity::Player::dyeItemFromDyeingInfo() uint32_t dyeBagSlot = m_dyeingInfo.dyeBagSlot; sendStateFlags(); // Retail sends all 0s to unlock player after a dye? Possibly not setting a flag when the action is started in the backend..? - auto itemToDye = getItemAt(itemToDyeContainer, itemToDyeSlot); - auto dyeToUse = getItemAt(dyeBagContainer, dyeBagSlot); + auto itemToDye = getItemAt( itemToDyeContainer, itemToDyeSlot ); + auto dyeToUse = getItemAt( dyeBagContainer, dyeBagSlot ); - if (!itemToDye || !dyeToUse) return; + if ( !itemToDye || !dyeToUse ) return; uint32_t stainColorID = dyeToUse->getAdditionalData(); - itemToDye->setStain(stainColorID); + itemToDye->setStain( stainColorID ); - //TODO: subtract/remove dye used + // TODO: subtract/remove dye used - insertInventoryItem((Sapphire::Common::InventoryType)itemToDyeContainer, (uint16_t)itemToDyeSlot, itemToDye); - writeItem(itemToDye); + insertInventoryItem( static_cast < Sapphire::Common::InventoryType > ( itemToDyeContainer ), static_cast < uint16_t > ( itemToDyeSlot ), itemToDye ); + writeItem( itemToDye ); } void Sapphire::Entity::Player::resetObjSpawnIndex() diff --git a/src/world/Actor/Player.h b/src/world/Actor/Player.h index 65cd334f..f74f864b 100644 --- a/src/world/Actor/Player.h +++ b/src/world/Actor/Player.h @@ -536,7 +536,7 @@ namespace Sapphire::Entity void clearTeleportQuery(); - void setDyeingInfo(uint32_t itemToDyeContainer, uint32_t itemToDyeSlot, uint32_t dyeBagContainer, uint32_t dyeBagSlot); + void setDyeingInfo( uint32_t itemToDyeContainer, uint32_t itemToDyeSlot, uint32_t dyeBagContainer, uint32_t dyeBagSlot ); void dyeItemFromDyeingInfo(); /*! prepares zoning / fades out the screen */ @@ -1123,7 +1123,7 @@ namespace Sapphire::Entity uint32_t itemToDyeSlot; uint32_t dyeBagContainer; uint32_t dyeBagSlot; - }; PlayerDyeingInfo m_dyeingInfo; + } m_dyeingInfo; Common::Util::SpawnIndexAllocator< uint8_t > m_objSpawnIndexAllocator; Common::Util::SpawnIndexAllocator< uint8_t > m_actorSpawnIndexAllocator; diff --git a/src/world/Network/Handlers/ClientTriggerHandler.cpp b/src/world/Network/Handlers/ClientTriggerHandler.cpp index e87be3c4..d0d56ccc 100644 --- a/src/world/Network/Handlers/ClientTriggerHandler.cpp +++ b/src/world/Network/Handlers/ClientTriggerHandler.cpp @@ -279,7 +279,11 @@ void Sapphire::Network::GameConnection::clientTriggerHandler( FrameworkPtr pFw, } case ClientTriggerType::DyeItem: // Dye item { - player.setDyeingInfo(param11, param12, param2, param4); + // param11 = item to dye container + // param12 = item to dye slot + // param2 = dye bag container + // param4 = dye bag slot + player.setDyeingInfo( param11, param12, param2, param4 ); break; } case ClientTriggerType::DirectorInitFinish: // Director init finish diff --git a/src/world/Network/PacketWrappers/ExaminePacket.h b/src/world/Network/PacketWrappers/ExaminePacket.h index a42b11ea..13f54726 100644 --- a/src/world/Network/PacketWrappers/ExaminePacket.h +++ b/src/world/Network/PacketWrappers/ExaminePacket.h @@ -74,7 +74,7 @@ namespace Sapphire::Network::Packets::Server auto& entry = m_data.entries[i]; entry.catalogId = pItem->getId(); entry.quality = pItem->isHq(); - entry.stain = (uint8_t)pItem->getStain(); //NOTE: More of this packet may be dye info? + entry.stain = static_cast < uint8_t > ( pItem->getStain() ); //entry.appearanceCatalogId = pItem->getGlamourId() // todo: glamour/materia etc. }