* More updating of iterator data types in loops, and fix a crash (sorry)
--HG-- branch : trunk
This commit is contained in:
+2
-2
@@ -159,11 +159,11 @@ struct TRINITY_DLL_DECL boss_kelidan_the_breakerAI : public ScriptedAI
|
||||
{
|
||||
SummonChannelers();
|
||||
if(!channeler1) return NULL;
|
||||
int i;
|
||||
uint8 i;
|
||||
for(i=0; i<5; ++i)
|
||||
{
|
||||
Creature *channeler = Unit::GetCreature(*m_creature, Channelers[i]);
|
||||
if(channeler && channeler->GetGUID()==channeler1->GetGUID())
|
||||
if(channeler && channeler->GetGUID() == channeler1->GetGUID())
|
||||
break;
|
||||
}
|
||||
return Channelers[(i+2)%5];
|
||||
|
||||
+62
-62
@@ -9626,7 +9626,7 @@ uint8 Player::_CanStoreItem( uint8 bag, uint8 slot, ItemPosCountVec &dest, uint3
|
||||
return EQUIP_ERR_CANT_CARRY_MORE_OF_THIS;
|
||||
}
|
||||
|
||||
for(int i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; i++)
|
||||
for(uint8 i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; i++)
|
||||
{
|
||||
res = _CanStoreItem_InBag(i,dest,pProto,count,false,true,pItem,bag,slot);
|
||||
if(res!=EQUIP_ERR_OK)
|
||||
@@ -9665,7 +9665,7 @@ uint8 Player::CanStoreItems( Item **pItems,int count) const
|
||||
memset(inv_keys,0,sizeof(int)*(KEYRING_SLOT_END-KEYRING_SLOT_START));
|
||||
memset(inv_tokens,0,sizeof(int)*(CURRENCYTOKEN_SLOT_END-CURRENCYTOKEN_SLOT_START));
|
||||
|
||||
for(int i = INVENTORY_SLOT_ITEM_START; i < INVENTORY_SLOT_ITEM_END; i++)
|
||||
for(uint8 i = INVENTORY_SLOT_ITEM_START; i < INVENTORY_SLOT_ITEM_END; i++)
|
||||
{
|
||||
pItem2 = GetItemByPos( INVENTORY_SLOT_BAG_0, i );
|
||||
|
||||
@@ -9675,7 +9675,7 @@ uint8 Player::CanStoreItems( Item **pItems,int count) const
|
||||
}
|
||||
}
|
||||
|
||||
for(int i = KEYRING_SLOT_START; i < KEYRING_SLOT_END; i++)
|
||||
for(uint8 i = KEYRING_SLOT_START; i < KEYRING_SLOT_END; i++)
|
||||
{
|
||||
pItem2 = GetItemByPos( INVENTORY_SLOT_BAG_0, i );
|
||||
|
||||
@@ -9685,7 +9685,7 @@ uint8 Player::CanStoreItems( Item **pItems,int count) const
|
||||
}
|
||||
}
|
||||
|
||||
for(int i = CURRENCYTOKEN_SLOT_START; i < CURRENCYTOKEN_SLOT_END; i++)
|
||||
for(uint8 i = CURRENCYTOKEN_SLOT_START; i < CURRENCYTOKEN_SLOT_END; i++)
|
||||
{
|
||||
pItem2 = GetItemByPos( INVENTORY_SLOT_BAG_0, i );
|
||||
|
||||
@@ -9695,7 +9695,7 @@ uint8 Player::CanStoreItems( Item **pItems,int count) const
|
||||
}
|
||||
}
|
||||
|
||||
for(int i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; i++)
|
||||
for(uint8 i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; i++)
|
||||
{
|
||||
if(Bag* pBag = (Bag*)GetItemByPos( INVENTORY_SLOT_BAG_0, i ))
|
||||
{
|
||||
@@ -9985,7 +9985,7 @@ uint8 Player::CanEquipItem( uint8 slot, uint16 &dest, Item *pItem, bool swap, bo
|
||||
// check unique-equipped special item classes
|
||||
if (pProto->Class == ITEM_CLASS_QUIVER)
|
||||
{
|
||||
for(int i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; ++i)
|
||||
for(uint8 i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; ++i)
|
||||
{
|
||||
if (Item* pBag = GetItemByPos(INVENTORY_SLOT_BAG_0, i))
|
||||
{
|
||||
@@ -10210,7 +10210,7 @@ uint8 Player::CanBankItem( uint8 bag, uint8 slot, ItemPosCountVec &dest, Item *p
|
||||
// in special bags
|
||||
if( pProto->BagFamily )
|
||||
{
|
||||
for(int i = BANK_SLOT_BAG_START; i < BANK_SLOT_BAG_END; i++)
|
||||
for(uint8 i = BANK_SLOT_BAG_START; i < BANK_SLOT_BAG_END; i++)
|
||||
{
|
||||
res = _CanStoreItem_InBag(i,dest,pProto,count,true,false,pItem,bag,slot);
|
||||
if(res!=EQUIP_ERR_OK)
|
||||
@@ -10221,7 +10221,7 @@ uint8 Player::CanBankItem( uint8 bag, uint8 slot, ItemPosCountVec &dest, Item *p
|
||||
}
|
||||
}
|
||||
|
||||
for(int i = BANK_SLOT_BAG_START; i < BANK_SLOT_BAG_END; i++)
|
||||
for(uint8 i = BANK_SLOT_BAG_START; i < BANK_SLOT_BAG_END; i++)
|
||||
{
|
||||
res = _CanStoreItem_InBag(i,dest,pProto,count,true,true,pItem,bag,slot);
|
||||
if(res!=EQUIP_ERR_OK)
|
||||
@@ -10235,7 +10235,7 @@ uint8 Player::CanBankItem( uint8 bag, uint8 slot, ItemPosCountVec &dest, Item *p
|
||||
// search free place in special bag
|
||||
if( pProto->BagFamily )
|
||||
{
|
||||
for(int i = BANK_SLOT_BAG_START; i < BANK_SLOT_BAG_END; i++)
|
||||
for(uint8 i = BANK_SLOT_BAG_START; i < BANK_SLOT_BAG_END; i++)
|
||||
{
|
||||
res = _CanStoreItem_InBag(i,dest,pProto,count,false,false,pItem,bag,slot);
|
||||
if(res!=EQUIP_ERR_OK)
|
||||
@@ -10254,7 +10254,7 @@ uint8 Player::CanBankItem( uint8 bag, uint8 slot, ItemPosCountVec &dest, Item *p
|
||||
if(count==0)
|
||||
return EQUIP_ERR_OK;
|
||||
|
||||
for(int i = BANK_SLOT_BAG_START; i < BANK_SLOT_BAG_END; i++)
|
||||
for(uint8 i = BANK_SLOT_BAG_START; i < BANK_SLOT_BAG_END; i++)
|
||||
{
|
||||
res = _CanStoreItem_InBag(i,dest,pProto,count,false,true,pItem,bag,slot);
|
||||
if(res!=EQUIP_ERR_OK)
|
||||
@@ -10872,7 +10872,7 @@ void Player::DestroyItem( uint8 bag, uint8 slot, bool update )
|
||||
// start from destroy contained items (only equipped bag can have its)
|
||||
if (pItem->IsBag() && pItem->IsEquipped()) // this also prevent infinity loop if empty bag stored in bag==slot
|
||||
{
|
||||
for (int i = 0; i < MAX_BAG_SIZE; ++i)
|
||||
for (uint8 i = 0; i < MAX_BAG_SIZE; ++i)
|
||||
DestroyItem(slot, i, update);
|
||||
}
|
||||
|
||||
@@ -10952,7 +10952,7 @@ void Player::DestroyItemCount( uint32 item, uint32 count, bool update, bool uneq
|
||||
uint32 remcount = 0;
|
||||
|
||||
// in inventory
|
||||
for(int i = INVENTORY_SLOT_ITEM_START; i < INVENTORY_SLOT_ITEM_END; i++)
|
||||
for(uint8 i = INVENTORY_SLOT_ITEM_START; i < INVENTORY_SLOT_ITEM_END; i++)
|
||||
{
|
||||
if (Item* pItem = GetItemByPos( INVENTORY_SLOT_BAG_0, i ))
|
||||
{
|
||||
@@ -10980,7 +10980,7 @@ void Player::DestroyItemCount( uint32 item, uint32 count, bool update, bool uneq
|
||||
}
|
||||
}
|
||||
|
||||
for(int i = KEYRING_SLOT_START; i < CURRENCYTOKEN_SLOT_END; ++i)
|
||||
for(uint8 i = KEYRING_SLOT_START; i < CURRENCYTOKEN_SLOT_END; ++i)
|
||||
{
|
||||
if (Item* pItem = GetItemByPos( INVENTORY_SLOT_BAG_0, i ))
|
||||
{
|
||||
@@ -11009,7 +11009,7 @@ void Player::DestroyItemCount( uint32 item, uint32 count, bool update, bool uneq
|
||||
}
|
||||
|
||||
// in inventory bags
|
||||
for(int i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; i++)
|
||||
for(uint8 i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; i++)
|
||||
{
|
||||
if(Bag *pBag = (Bag*)GetItemByPos( INVENTORY_SLOT_BAG_0, i ))
|
||||
{
|
||||
@@ -11044,7 +11044,7 @@ void Player::DestroyItemCount( uint32 item, uint32 count, bool update, bool uneq
|
||||
}
|
||||
|
||||
// in equipment and bag list
|
||||
for(int i = EQUIPMENT_SLOT_START; i < INVENTORY_SLOT_BAG_END; i++)
|
||||
for(uint8 i = EQUIPMENT_SLOT_START; i < INVENTORY_SLOT_BAG_END; i++)
|
||||
{
|
||||
if (Item* pItem = GetItemByPos( INVENTORY_SLOT_BAG_0, i ))
|
||||
{
|
||||
@@ -11080,18 +11080,18 @@ void Player::DestroyZoneLimitedItem( bool update, uint32 new_zone )
|
||||
sLog.outDebug( "STORAGE: DestroyZoneLimitedItem in map %u and area %u", GetMapId(), new_zone );
|
||||
|
||||
// in inventory
|
||||
for(int i = INVENTORY_SLOT_ITEM_START; i < INVENTORY_SLOT_ITEM_END; i++)
|
||||
for(uint8 i = INVENTORY_SLOT_ITEM_START; i < INVENTORY_SLOT_ITEM_END; i++)
|
||||
if (Item* pItem = GetItemByPos( INVENTORY_SLOT_BAG_0, i ))
|
||||
if (pItem->IsLimitedToAnotherMapOrZone(GetMapId(), new_zone))
|
||||
DestroyItem( INVENTORY_SLOT_BAG_0, i, update);
|
||||
|
||||
for(int i = KEYRING_SLOT_START; i < CURRENCYTOKEN_SLOT_END; ++i)
|
||||
for(uint8 i = KEYRING_SLOT_START; i < CURRENCYTOKEN_SLOT_END; ++i)
|
||||
if (Item* pItem = GetItemByPos( INVENTORY_SLOT_BAG_0, i ))
|
||||
if (pItem->IsLimitedToAnotherMapOrZone(GetMapId(), new_zone))
|
||||
DestroyItem( INVENTORY_SLOT_BAG_0, i, update);
|
||||
|
||||
// in inventory bags
|
||||
for(int i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; i++)
|
||||
for(uint8 i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; i++)
|
||||
if (Bag* pBag = (Bag*)GetItemByPos( INVENTORY_SLOT_BAG_0, i ))
|
||||
for(uint32 j = 0; j < pBag->GetBagSize(); j++)
|
||||
if (Item* pItem = pBag->GetItemByPos(j))
|
||||
@@ -11099,7 +11099,7 @@ void Player::DestroyZoneLimitedItem( bool update, uint32 new_zone )
|
||||
DestroyItem(i, j, update);
|
||||
|
||||
// in equipment and bag list
|
||||
for(int i = EQUIPMENT_SLOT_START; i < INVENTORY_SLOT_BAG_END; i++)
|
||||
for(uint8 i = EQUIPMENT_SLOT_START; i < INVENTORY_SLOT_BAG_END; i++)
|
||||
if (Item* pItem = GetItemByPos( INVENTORY_SLOT_BAG_0, i ))
|
||||
if (pItem->IsLimitedToAnotherMapOrZone(GetMapId(), new_zone))
|
||||
DestroyItem( INVENTORY_SLOT_BAG_0, i, update);
|
||||
@@ -11112,13 +11112,13 @@ void Player::DestroyConjuredItems( bool update )
|
||||
sLog.outDebug( "STORAGE: DestroyConjuredItems" );
|
||||
|
||||
// in inventory
|
||||
for(int i = INVENTORY_SLOT_ITEM_START; i < INVENTORY_SLOT_ITEM_END; i++)
|
||||
for(uint8 i = INVENTORY_SLOT_ITEM_START; i < INVENTORY_SLOT_ITEM_END; i++)
|
||||
if (Item* pItem = GetItemByPos( INVENTORY_SLOT_BAG_0, i ))
|
||||
if (pItem->IsConjuredConsumable())
|
||||
DestroyItem( INVENTORY_SLOT_BAG_0, i, update);
|
||||
|
||||
// in inventory bags
|
||||
for(int i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; i++)
|
||||
for(uint8 i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; i++)
|
||||
if (Bag* pBag = (Bag*)GetItemByPos( INVENTORY_SLOT_BAG_0, i ))
|
||||
for(uint32 j = 0; j < pBag->GetBagSize(); j++)
|
||||
if (Item* pItem = pBag->GetItemByPos(j))
|
||||
@@ -11126,7 +11126,7 @@ void Player::DestroyConjuredItems( bool update )
|
||||
DestroyItem( i, j, update);
|
||||
|
||||
// in equipment and bag list
|
||||
for(int i = EQUIPMENT_SLOT_START; i < INVENTORY_SLOT_BAG_END; i++)
|
||||
for(uint8 i = EQUIPMENT_SLOT_START; i < INVENTORY_SLOT_BAG_END; i++)
|
||||
if (Item* pItem = GetItemByPos( INVENTORY_SLOT_BAG_0, i ))
|
||||
if (pItem->IsConjuredConsumable())
|
||||
DestroyItem( INVENTORY_SLOT_BAG_0, i, update);
|
||||
@@ -11501,7 +11501,7 @@ void Player::SwapItem( uint16 src, uint16 dst )
|
||||
|
||||
uint32 count = 0;
|
||||
|
||||
for(int i=0; i < fullBag->GetBagSize(); ++i)
|
||||
for(uint32 i=0; i < fullBag->GetBagSize(); ++i)
|
||||
{
|
||||
Item *bagItem = fullBag->GetItemByPos(i);
|
||||
if (!bagItem)
|
||||
@@ -11528,7 +11528,7 @@ void Player::SwapItem( uint16 src, uint16 dst )
|
||||
|
||||
// Items swap
|
||||
count = 0; // will pos in new bag
|
||||
for(int i = 0; i< fullBag->GetBagSize(); ++i)
|
||||
for(uint32 i = 0; i< fullBag->GetBagSize(); ++i)
|
||||
{
|
||||
Item *bagItem = fullBag->GetItemByPos(i);
|
||||
if (!bagItem)
|
||||
@@ -11708,7 +11708,7 @@ void Player::ClearTrade()
|
||||
{
|
||||
tradeGold = 0;
|
||||
acceptTrade = false;
|
||||
for(int i = 0; i < TRADE_SLOT_COUNT; i++)
|
||||
for(uint8 i = 0; i < TRADE_SLOT_COUNT; i++)
|
||||
tradeItems[i] = NULL_SLOT;
|
||||
}
|
||||
|
||||
@@ -11834,7 +11834,7 @@ void Player::RemoveArenaEnchantments(EnchantmentSlot slot)
|
||||
// remove enchants from inventory items
|
||||
// NOTE: no need to remove these from stats, since these aren't equipped
|
||||
// in inventory
|
||||
for(int i = INVENTORY_SLOT_ITEM_START; i < INVENTORY_SLOT_ITEM_END; i++)
|
||||
for(uint8 i = INVENTORY_SLOT_ITEM_START; i < INVENTORY_SLOT_ITEM_END; i++)
|
||||
{
|
||||
Item* pItem = GetItemByPos( INVENTORY_SLOT_BAG_0, i );
|
||||
if( pItem && pItem->GetEnchantmentId(slot) )
|
||||
@@ -11842,7 +11842,7 @@ void Player::RemoveArenaEnchantments(EnchantmentSlot slot)
|
||||
}
|
||||
|
||||
// in inventory bags
|
||||
for(int i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; i++)
|
||||
for(uint8 i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; i++)
|
||||
{
|
||||
Bag* pBag = (Bag*)GetItemByPos( INVENTORY_SLOT_BAG_0, i );
|
||||
if( pBag )
|
||||
@@ -12547,7 +12547,7 @@ bool Player::CanCompleteQuest( uint32 quest_id )
|
||||
|
||||
if ( qInfo->HasFlag( QUEST_TRINITY_FLAGS_DELIVER ) )
|
||||
{
|
||||
for(int i = 0; i < QUEST_OBJECTIVES_COUNT; i++)
|
||||
for(uint8 i = 0; i < QUEST_OBJECTIVES_COUNT; i++)
|
||||
{
|
||||
if( qInfo->ReqItemCount[i]!= 0 && q_status.m_itemcount[i] < qInfo->ReqItemCount[i] )
|
||||
return false;
|
||||
@@ -12556,7 +12556,7 @@ bool Player::CanCompleteQuest( uint32 quest_id )
|
||||
|
||||
if ( qInfo->HasFlag(QUEST_TRINITY_FLAGS_KILL_OR_CAST | QUEST_TRINITY_FLAGS_SPEAKTO) )
|
||||
{
|
||||
for(int i = 0; i < QUEST_OBJECTIVES_COUNT; i++)
|
||||
for(uint8 i = 0; i < QUEST_OBJECTIVES_COUNT; i++)
|
||||
{
|
||||
if( qInfo->ReqCreatureOrGOId[i] == 0 )
|
||||
continue;
|
||||
@@ -12597,7 +12597,7 @@ bool Player::CanCompleteRepeatableQuest( Quest const *pQuest )
|
||||
return false;
|
||||
|
||||
if (pQuest->HasFlag( QUEST_TRINITY_FLAGS_DELIVER) )
|
||||
for(int i = 0; i < QUEST_OBJECTIVES_COUNT; i++)
|
||||
for(uint8 i = 0; i < QUEST_OBJECTIVES_COUNT; i++)
|
||||
if( pQuest->ReqItemId[i] && pQuest->ReqItemCount[i] && !HasItemCount(pQuest->ReqItemId[i],pQuest->ReqItemCount[i]) )
|
||||
return false;
|
||||
|
||||
@@ -12624,7 +12624,7 @@ bool Player::CanRewardQuest( Quest const *pQuest, bool msg )
|
||||
// prevent receive reward with quest items in bank
|
||||
if ( pQuest->HasFlag( QUEST_TRINITY_FLAGS_DELIVER ) )
|
||||
{
|
||||
for(int i = 0; i < QUEST_OBJECTIVES_COUNT; i++)
|
||||
for(uint8 i = 0; i < QUEST_OBJECTIVES_COUNT; i++)
|
||||
{
|
||||
if( pQuest->ReqItemCount[i]!= 0 &&
|
||||
GetItemCount(pQuest->ReqItemId[i]) < pQuest->ReqItemCount[i] )
|
||||
@@ -12699,13 +12699,13 @@ void Player::AddQuest( Quest const *pQuest, Object *questGiver )
|
||||
|
||||
if ( pQuest->HasFlag( QUEST_TRINITY_FLAGS_DELIVER ) )
|
||||
{
|
||||
for(int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i)
|
||||
for(uint8 i = 0; i < QUEST_OBJECTIVES_COUNT; ++i)
|
||||
questStatusData.m_itemcount[i] = 0;
|
||||
}
|
||||
|
||||
if ( pQuest->HasFlag(QUEST_TRINITY_FLAGS_KILL_OR_CAST | QUEST_TRINITY_FLAGS_SPEAKTO) )
|
||||
{
|
||||
for(int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i)
|
||||
for(uint8 i = 0; i < QUEST_OBJECTIVES_COUNT; ++i)
|
||||
questStatusData.m_creatureOrGOcount[i] = 0;
|
||||
}
|
||||
|
||||
@@ -12793,7 +12793,7 @@ void Player::RewardQuest( Quest const *pQuest, uint32 reward, Object* questGiver
|
||||
{
|
||||
uint32 quest_id = pQuest->GetQuestId();
|
||||
|
||||
for (int i = 0; i < QUEST_OBJECTIVES_COUNT; i++ )
|
||||
for (uint8 i = 0; i < QUEST_OBJECTIVES_COUNT; i++ )
|
||||
{
|
||||
if ( pQuest->ReqItemId[i] )
|
||||
DestroyItemCount( pQuest->ReqItemId[i], pQuest->ReqItemCount[i], true);
|
||||
@@ -13506,7 +13506,7 @@ void Player::AdjustQuestReqItemCount( Quest const* pQuest, QuestStatusData& ques
|
||||
{
|
||||
if ( pQuest->HasFlag( QUEST_TRINITY_FLAGS_DELIVER ) )
|
||||
{
|
||||
for(int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i)
|
||||
for(uint8 i = 0; i < QUEST_OBJECTIVES_COUNT; ++i)
|
||||
{
|
||||
uint32 reqitemcount = pQuest->ReqItemCount[i];
|
||||
if( reqitemcount != 0 )
|
||||
@@ -13570,7 +13570,7 @@ void Player::GroupEventHappens( uint32 questId, WorldObject const* pEventObject
|
||||
|
||||
void Player::ItemAddedQuestCheck( uint32 entry, uint32 count )
|
||||
{
|
||||
for( int i = 0; i < MAX_QUEST_LOG_SIZE; ++i )
|
||||
for( uint8 i = 0; i < MAX_QUEST_LOG_SIZE; ++i )
|
||||
{
|
||||
uint32 questid = GetQuestSlotQuestId(i);
|
||||
if ( questid == 0 )
|
||||
@@ -13611,7 +13611,7 @@ void Player::ItemAddedQuestCheck( uint32 entry, uint32 count )
|
||||
|
||||
void Player::ItemRemovedQuestCheck( uint32 entry, uint32 count )
|
||||
{
|
||||
for( int i = 0; i < MAX_QUEST_LOG_SIZE; ++i )
|
||||
for( uint8 i = 0; i < MAX_QUEST_LOG_SIZE; ++i )
|
||||
{
|
||||
uint32 questid = GetQuestSlotQuestId(i);
|
||||
if(!questid)
|
||||
@@ -13654,7 +13654,7 @@ void Player::KilledMonster( uint32 entry, uint64 guid )
|
||||
{
|
||||
uint32 addkillcount = 1;
|
||||
GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE, entry, addkillcount);
|
||||
for( int i = 0; i < MAX_QUEST_LOG_SIZE; ++i )
|
||||
for( uint8 i = 0; i < MAX_QUEST_LOG_SIZE; ++i )
|
||||
{
|
||||
uint32 questid = GetQuestSlotQuestId(i);
|
||||
if(!questid)
|
||||
@@ -13709,7 +13709,7 @@ void Player::CastedCreatureOrGO( uint32 entry, uint64 guid, uint32 spell_id )
|
||||
bool isCreature = IS_CREATURE_GUID(guid);
|
||||
|
||||
uint32 addCastCount = 1;
|
||||
for( int i = 0; i < MAX_QUEST_LOG_SIZE; ++i)
|
||||
for( uint8 i = 0; i < MAX_QUEST_LOG_SIZE; ++i)
|
||||
{
|
||||
uint32 questid = GetQuestSlotQuestId(i);
|
||||
if(!questid)
|
||||
@@ -13776,7 +13776,7 @@ void Player::CastedCreatureOrGO( uint32 entry, uint64 guid, uint32 spell_id )
|
||||
void Player::TalkedToCreature( uint32 entry, uint64 guid )
|
||||
{
|
||||
uint32 addTalkCount = 1;
|
||||
for( int i = 0; i < MAX_QUEST_LOG_SIZE; ++i )
|
||||
for( uint8 i = 0; i < MAX_QUEST_LOG_SIZE; ++i )
|
||||
{
|
||||
uint32 questid = GetQuestSlotQuestId(i);
|
||||
if(!questid)
|
||||
@@ -13831,7 +13831,7 @@ void Player::TalkedToCreature( uint32 entry, uint64 guid )
|
||||
|
||||
void Player::MoneyChanged( uint32 count )
|
||||
{
|
||||
for( int i = 0; i < MAX_QUEST_LOG_SIZE; ++i )
|
||||
for( uint8 i = 0; i < MAX_QUEST_LOG_SIZE; ++i )
|
||||
{
|
||||
uint32 questid = GetQuestSlotQuestId(i);
|
||||
if (!questid)
|
||||
@@ -13861,7 +13861,7 @@ void Player::MoneyChanged( uint32 count )
|
||||
|
||||
void Player::ReputationChanged(FactionEntry const* factionEntry )
|
||||
{
|
||||
for( int i = 0; i < MAX_QUEST_LOG_SIZE; ++i )
|
||||
for( uint8 i = 0; i < MAX_QUEST_LOG_SIZE; ++i )
|
||||
{
|
||||
if(uint32 questid = GetQuestSlotQuestId(i))
|
||||
{
|
||||
@@ -13889,7 +13889,7 @@ void Player::ReputationChanged(FactionEntry const* factionEntry )
|
||||
|
||||
bool Player::HasQuestForItem( uint32 itemid ) const
|
||||
{
|
||||
for( int i = 0; i < MAX_QUEST_LOG_SIZE; ++i )
|
||||
for( uint8 i = 0; i < MAX_QUEST_LOG_SIZE; ++i )
|
||||
{
|
||||
uint32 questid = GetQuestSlotQuestId(i);
|
||||
if ( questid == 0 )
|
||||
@@ -14107,7 +14107,7 @@ bool Player::MinimalLoadFromDB( QueryResult *result, uint32 guid )
|
||||
if (delete_result)
|
||||
delete result;
|
||||
|
||||
for (int i = 0; i < PLAYER_SLOTS_COUNT; i++)
|
||||
for (uint8 i = 0; i < PLAYER_SLOTS_COUNT; i++)
|
||||
m_items[i] = NULL;
|
||||
|
||||
if (HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_GHOST))
|
||||
@@ -14126,7 +14126,7 @@ void Player::_LoadDeclinedNames(QueryResult* result)
|
||||
|
||||
m_declinedname = new DeclinedName;
|
||||
Field *fields = result->Fetch();
|
||||
for(int i = 0; i < MAX_DECLINED_NAME_CASES; ++i)
|
||||
for(uint8 i = 0; i < MAX_DECLINED_NAME_CASES; ++i)
|
||||
m_declinedname->name[i] = fields[i].GetCppString();
|
||||
|
||||
delete result;
|
||||
@@ -15204,7 +15204,7 @@ void Player::_LoadInventory(QueryResult *result, uint32 timediff)
|
||||
// fill mail
|
||||
MailItemsInfo mi; // item list preparing
|
||||
|
||||
for(int i = 0; !problematicItems.empty() && i < MAX_MAIL_ITEMS; ++i)
|
||||
for(uint8 i = 0; !problematicItems.empty() && i < MAX_MAIL_ITEMS; ++i)
|
||||
{
|
||||
Item* item = problematicItems.front();
|
||||
problematicItems.pop_front();
|
||||
@@ -15646,7 +15646,7 @@ void Player::SendRaidInfo()
|
||||
|
||||
time_t now = time(NULL);
|
||||
|
||||
for(int i = 0; i < TOTAL_DIFFICULTIES; ++i)
|
||||
for(uint8 i = 0; i < TOTAL_DIFFICULTIES; ++i)
|
||||
{
|
||||
for (BoundInstancesMap::iterator itr = m_boundInstances[i].begin(); itr != m_boundInstances[i].end(); ++itr)
|
||||
{
|
||||
@@ -15878,7 +15878,7 @@ void Player::SaveToDB()
|
||||
// first save/honor gain after midnight will also update the player's honor fields
|
||||
UpdateHonorFields();
|
||||
|
||||
int is_save_resting = HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING) ? 1 : 0;
|
||||
uint8 is_save_resting = HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING) ? 1 : 0;
|
||||
//save, far from tavern/city
|
||||
//save, but in tavern/city
|
||||
sLog.outDebug("The value of player %s at save: ", m_name.c_str());
|
||||
@@ -16412,7 +16412,7 @@ bool Player::SaveValuesArrayInDB(Tokens const& tokens, uint64 guid)
|
||||
{
|
||||
std::ostringstream ss2;
|
||||
ss2<<"UPDATE characters SET data='";
|
||||
int i=0;
|
||||
uint32 i=0;
|
||||
for (Tokens::const_iterator iter = tokens.begin(); iter != tokens.end(); ++iter, ++i)
|
||||
{
|
||||
ss2<<tokens[i]<<" ";
|
||||
@@ -17126,7 +17126,7 @@ void Player::RestoreSpellMods(Spell * spell)
|
||||
if (!spell || spell->m_appliedMods.empty())
|
||||
return;
|
||||
|
||||
for(int i=0;i<MAX_SPELLMOD;++i)
|
||||
for(uint8 i=0;i<MAX_SPELLMOD;++i)
|
||||
{
|
||||
for (SpellModList::iterator itr = m_spellMods[i].begin(); itr != m_spellMods[i].end();++itr)
|
||||
{
|
||||
@@ -17193,7 +17193,7 @@ void Player::RemoveSpellMods(Spell * spell)
|
||||
if (spell->m_appliedMods.empty())
|
||||
return;
|
||||
|
||||
for(int i=0;i<MAX_SPELLMOD;++i)
|
||||
for(uint8 i=0;i<MAX_SPELLMOD;++i)
|
||||
{
|
||||
for (SpellModList::iterator itr = m_spellMods[i].begin(); itr != m_spellMods[i].end();)
|
||||
{
|
||||
@@ -17774,7 +17774,7 @@ bool Player::BuyItemFromVendor(uint64 vendorguid, uint32 item, uint8 count, uint
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END;i++)
|
||||
for (uint8 i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END;i++)
|
||||
{
|
||||
pBag = (Bag*)GetItemByPos(INVENTORY_SLOT_BAG_0,i);
|
||||
if( pBag )
|
||||
@@ -17890,7 +17890,7 @@ uint32 Player::GetMaxPersonalArenaRatingRequirement()
|
||||
// the personal rating of the arena team must match the required limit as well
|
||||
// so return max[in arenateams](min(personalrating[teamtype], teamrating[teamtype]))
|
||||
uint32 max_personal_rating = 0;
|
||||
for(int i = 0; i < MAX_ARENA_SLOT; ++i)
|
||||
for(uint8 i = 0; i < MAX_ARENA_SLOT; ++i)
|
||||
{
|
||||
if(ArenaTeam * at = objmgr.GetArenaTeamById(GetArenaTeamId(i)))
|
||||
{
|
||||
@@ -18009,7 +18009,7 @@ void Player::AddSpellAndCategoryCooldowns(SpellEntry const* spellInfo, uint32 it
|
||||
{
|
||||
if(ItemPrototype const* proto = ObjectMgr::GetItemPrototype(itemId))
|
||||
{
|
||||
for(int idx = 0; idx < 5; ++idx)
|
||||
for(uint8 idx = 0; idx < 5; ++idx)
|
||||
{
|
||||
if(proto->Spells[idx].SpellId == spellInfo->Id)
|
||||
{
|
||||
@@ -18121,7 +18121,7 @@ void Player::UpdatePotionCooldown(Spell* spell)
|
||||
{
|
||||
// spell/item pair let set proper cooldown (except not existed charged spell cooldown spellmods for potions)
|
||||
if(ItemPrototype const* proto = ObjectMgr::GetItemPrototype(m_lastPotionId))
|
||||
for(int idx = 0; idx < 5; ++idx)
|
||||
for(uint8 idx = 0; idx < 5; ++idx)
|
||||
if(proto->Spells[idx].SpellId && proto->Spells[idx].SpellTrigger == ITEM_SPELLTRIGGER_ON_USE)
|
||||
if(SpellEntry const* spellInfo = sSpellStore.LookupEntry(proto->Spells[idx].SpellId))
|
||||
SendCooldownEvent(spellInfo,m_lastPotionId);
|
||||
@@ -18189,7 +18189,7 @@ bool Player::EnchantmentFitsRequirements(uint32 enchantmentcondition, int8 slot)
|
||||
|
||||
bool activate = true;
|
||||
|
||||
for(int i = 0; i < 5; i++)
|
||||
for(uint8 i = 0; i < 5; i++)
|
||||
{
|
||||
if(!Condition->Color[i])
|
||||
continue;
|
||||
@@ -18847,7 +18847,7 @@ void Player::SendInstanceResetWarning( uint32 mapid, uint32 difficulty, uint32 t
|
||||
|
||||
void Player::ApplyEquipCooldown( Item * pItem )
|
||||
{
|
||||
for(int i = 0; i < MAX_ITEM_PROTO_SPELLS; ++i)
|
||||
for(uint8 i = 0; i < MAX_ITEM_PROTO_SPELLS; ++i)
|
||||
{
|
||||
_Spell const& spellData = pItem->GetProto()->Spells[i];
|
||||
|
||||
@@ -18917,7 +18917,7 @@ void Player::learnQuestRewardedSpells(Quest const* quest)
|
||||
|
||||
// check learned spells state
|
||||
bool found = false;
|
||||
for(int i=0; i < 3; ++i)
|
||||
for(uint8 i=0; i < 3; ++i)
|
||||
{
|
||||
if(spellInfo->Effect[i] == SPELL_EFFECT_LEARN_SPELL && !HasSpell(spellInfo->EffectTriggerSpell[i]))
|
||||
{
|
||||
@@ -19172,7 +19172,7 @@ bool Player::IsSpellFitByClassAndRace( uint32 spell_id ) const
|
||||
|
||||
bool Player::HasQuestForGO(int32 GOId) const
|
||||
{
|
||||
for( int i = 0; i < MAX_QUEST_LOG_SIZE; ++i )
|
||||
for( uint8 i = 0; i < MAX_QUEST_LOG_SIZE; ++i )
|
||||
{
|
||||
uint32 questid = GetQuestSlotQuestId(i);
|
||||
if ( questid == 0 )
|
||||
@@ -19346,7 +19346,7 @@ bool Player::HasItemFitToSpellReqirements(SpellEntry const* spellInfo, Item cons
|
||||
{
|
||||
case ITEM_CLASS_WEAPON:
|
||||
{
|
||||
for(int i= EQUIPMENT_SLOT_MAINHAND; i < EQUIPMENT_SLOT_TABARD; ++i)
|
||||
for(uint8 i= EQUIPMENT_SLOT_MAINHAND; i < EQUIPMENT_SLOT_TABARD; ++i)
|
||||
if(Item *item = GetUseableItemByPos( INVENTORY_SLOT_BAG_0, i ))
|
||||
if(item!=ignoreItem && item->IsFitToSpellRequirements(spellInfo))
|
||||
return true;
|
||||
@@ -19355,7 +19355,7 @@ bool Player::HasItemFitToSpellReqirements(SpellEntry const* spellInfo, Item cons
|
||||
case ITEM_CLASS_ARMOR:
|
||||
{
|
||||
// tabard not have dependent spells
|
||||
for(int i= EQUIPMENT_SLOT_START; i< EQUIPMENT_SLOT_MAINHAND; ++i)
|
||||
for(uint8 i= EQUIPMENT_SLOT_START; i< EQUIPMENT_SLOT_MAINHAND; ++i)
|
||||
if(Item *item = GetUseableItemByPos( INVENTORY_SLOT_BAG_0, i ))
|
||||
if(item!=ignoreItem && item->IsFitToSpellRequirements(spellInfo))
|
||||
return true;
|
||||
@@ -20655,7 +20655,7 @@ void Player::LearnPetTalent(uint64 petGuid, uint32 talentId, uint32 talentRank)
|
||||
|
||||
// find current max talent rank
|
||||
int32 curtalent_maxrank = 0;
|
||||
for(uint8 k = MAX_TALENT_RANK-1; k > -1; --k)
|
||||
for(int8 k = MAX_TALENT_RANK-1; k > -1; --k)
|
||||
{
|
||||
if(talentInfo->RankID[k] && pet->HasSpell(talentInfo->RankID[k]))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user