1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-04-25 05:57:45 +00:00

style + cast changes

This commit is contained in:
Arazati 2020-03-16 01:35:49 -07:00
parent 4c75f1fd32
commit 02f1bd71c5
4 changed files with 16 additions and 12 deletions

View file

@ -1926,7 +1926,7 @@ uint8_t Sapphire::Entity::Player::getNextObjSpawnIndexForActorId( uint32_t actor
return index; 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.itemToDyeContainer = itemToDyeContainer;
m_dyeingInfo.itemToDyeSlot = itemToDyeSlot; m_dyeingInfo.itemToDyeSlot = itemToDyeSlot;
@ -1942,18 +1942,18 @@ void Sapphire::Entity::Player::dyeItemFromDyeingInfo()
uint32_t dyeBagSlot = m_dyeingInfo.dyeBagSlot; 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..? 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 itemToDye = getItemAt( itemToDyeContainer, itemToDyeSlot );
auto dyeToUse = getItemAt(dyeBagContainer, dyeBagSlot); auto dyeToUse = getItemAt( dyeBagContainer, dyeBagSlot );
if (!itemToDye || !dyeToUse) return; if ( !itemToDye || !dyeToUse ) return;
uint32_t stainColorID = dyeToUse->getAdditionalData(); 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); insertInventoryItem( static_cast < Sapphire::Common::InventoryType > ( itemToDyeContainer ), static_cast < uint16_t > ( itemToDyeSlot ), itemToDye );
writeItem(itemToDye); writeItem( itemToDye );
} }
void Sapphire::Entity::Player::resetObjSpawnIndex() void Sapphire::Entity::Player::resetObjSpawnIndex()

View file

@ -536,7 +536,7 @@ namespace Sapphire::Entity
void clearTeleportQuery(); 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(); void dyeItemFromDyeingInfo();
/*! prepares zoning / fades out the screen */ /*! prepares zoning / fades out the screen */
@ -1123,7 +1123,7 @@ namespace Sapphire::Entity
uint32_t itemToDyeSlot; uint32_t itemToDyeSlot;
uint32_t dyeBagContainer; uint32_t dyeBagContainer;
uint32_t dyeBagSlot; uint32_t dyeBagSlot;
}; PlayerDyeingInfo m_dyeingInfo; } m_dyeingInfo;
Common::Util::SpawnIndexAllocator< uint8_t > m_objSpawnIndexAllocator; Common::Util::SpawnIndexAllocator< uint8_t > m_objSpawnIndexAllocator;
Common::Util::SpawnIndexAllocator< uint8_t > m_actorSpawnIndexAllocator; Common::Util::SpawnIndexAllocator< uint8_t > m_actorSpawnIndexAllocator;

View file

@ -279,7 +279,11 @@ void Sapphire::Network::GameConnection::clientTriggerHandler( FrameworkPtr pFw,
} }
case ClientTriggerType::DyeItem: // Dye item 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; break;
} }
case ClientTriggerType::DirectorInitFinish: // Director init finish case ClientTriggerType::DirectorInitFinish: // Director init finish

View file

@ -74,7 +74,7 @@ namespace Sapphire::Network::Packets::Server
auto& entry = m_data.entries[i]; auto& entry = m_data.entries[i];
entry.catalogId = pItem->getId(); entry.catalogId = pItem->getId();
entry.quality = pItem->isHq(); 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() //entry.appearanceCatalogId = pItem->getGlamourId()
// todo: glamour/materia etc. // todo: glamour/materia etc.
} }