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

Merge pull request #157 from ShelbyZ/static_cast_round_2

More static_cast
This commit is contained in:
Mordred 2017-10-24 07:52:43 +02:00 committed by GitHub
commit d5e24c97e5
6 changed files with 11 additions and 11 deletions

View file

@ -23,7 +23,7 @@ DROP TABLE IF EXISTS `infolinkshell`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `infolinkshell` (
`LinkshellId` int(20) NOT NULL AUTO_INCREMENT,
`LinkshellId` bigint(20) NOT NULL AUTO_INCREMENT,
`MasterCharacterId` int(20) DEFAULT NULL,
`CharacterIdList` blob,
`LinkshellName` varchar(32) DEFAULT NULL,

View file

@ -74,7 +74,7 @@ bool Core::Entity::Player::loadActiveQuests()
void Core::Entity::Player::finishQuest( uint16_t questId )
{
int16_t idx = getQuestIndex( questId );
auto idx = static_cast< uint8_t >( getQuestIndex( questId ) );
if( ( idx != -1 ) && ( m_activeQuests[idx] != nullptr ) )
{
@ -123,7 +123,7 @@ void Core::Entity::Player::unfinishQuest( uint16_t questId )
void Core::Entity::Player::removeQuest( uint16_t questId )
{
int16_t idx = getQuestIndex( questId );
auto idx = static_cast< uint8_t >( getQuestIndex( questId ) );
if( ( idx != -1 ) && ( m_activeQuests[idx] != nullptr ) )
{
@ -978,7 +978,7 @@ void Core::Entity::Player::updateQuest( uint16_t questId, uint8_t sequence )
if( hasQuest( questId ) )
{
GamePacketNew< FFXIVIpcQuestUpdate, ServerZoneIpcType > pe_qa( getId() );
int16_t index = getQuestIndex( questId );
auto index = static_cast< uint8_t >( getQuestIndex( questId ) );
auto pNewQuest = m_activeQuests[index];
pe_qa.data().slot = index;
pNewQuest->c.sequence = sequence;
@ -1038,7 +1038,7 @@ void Core::Entity::Player::sendQuestTracker()
if( m_questTracking[ii] >= 0 )
{
trackerPacket.data().entry[ii].active = 1;
trackerPacket.data().entry[ii].questIndex = m_questTracking[ii];
trackerPacket.data().entry[ii].questIndex = static_cast< uint8_t >( m_questTracking[ii] );
}
}
queuePacket( trackerPacket );

View file

@ -108,7 +108,7 @@ Core::Inventory::InvSlotPairVec Core::Inventory::getSlotsOfItemsInInventory( uin
for( auto item : inv->getItemMap() )
{
if( item.second && item.second->getId() == catalogId )
outVec.push_back( std::make_pair( i, item.first ) );
outVec.push_back( std::make_pair( i, static_cast< int8_t >( item.first ) ) );
}
}
return outVec;
@ -118,7 +118,7 @@ Core::Inventory::InvSlotPair Core::Inventory::getFreeBagSlot()
{
for( auto i : { Bag0, Bag1, Bag2, Bag3 } )
{
int16_t freeSlot = m_inventoryMap[i]->getFreeSlot();
auto freeSlot = static_cast< int8_t >( m_inventoryMap[i]->getFreeSlot() );
if( freeSlot != -1 )
return std::make_pair( i, freeSlot );
@ -457,7 +457,7 @@ int16_t Core::Inventory::addItem( uint16_t inventoryId, int8_t slotId, uint32_t
return -1;
}
int16_t rSlotId = -1;
int8_t rSlotId = -1;
//if( itemInfo->stack_size > 1 )
//{

View file

@ -29,7 +29,7 @@ bool Core::LinkshellMgr::loadLinkshells()
do
{
uint32_t linkshellId = field[0].get< uint32_t >();
uint64_t linkshellId = field[0].get< uint64_t >();
uint32_t masterId = field[1].get< uint32_t >();
std::string name = field[3].getString();

View file

@ -12,7 +12,7 @@ typedef boost::shared_ptr< Linkshell > LinkshellPtr;
class LinkshellMgr
{
private:
std::map< uint32_t, LinkshellPtr > m_linkshellIdMap;
std::map< uint64_t, LinkshellPtr > m_linkshellIdMap;
std::map< std::string, LinkshellPtr > m_linkshellNameMap;
LinkshellPtr getLinkshellByName( const std::string& name );

View file

@ -141,7 +141,7 @@ void Core::Network::GameConnection::eventHandler( const Packets::GamePacket& inP
GamePacketNew< FFXIVIpcEventLinkshell, ServerZoneIpcType > linkshellEvent( pPlayer->getId() );
linkshellEvent.data().eventId = eventId;
linkshellEvent.data().scene = subEvent;
linkshellEvent.data().scene = static_cast< uint8_t >(subEvent);
linkshellEvent.data().param3 = 1;
linkshellEvent.data().unknown1 = 0x15a;
pPlayer->queuePacket( linkshellEvent );