Core: Fix more warnings
--HG-- branch : trunk
This commit is contained in:
@@ -1514,7 +1514,7 @@ struct BG_AV_NodeInfo
|
|||||||
uint16 PrevOwner;
|
uint16 PrevOwner;
|
||||||
BG_AV_States State;
|
BG_AV_States State;
|
||||||
BG_AV_States PrevState;
|
BG_AV_States PrevState;
|
||||||
int Timer;
|
uint Timer;
|
||||||
bool Tower;
|
bool Tower;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1985,7 +1985,7 @@ bool Creature::_IsTargetAcceptable(const Unit *target) const
|
|||||||
|
|
||||||
void Creature::SaveRespawnTime()
|
void Creature::SaveRespawnTime()
|
||||||
{
|
{
|
||||||
if (isSummon() || !m_DBTableGuid || m_creatureData && !m_creatureData->dbData)
|
if (isSummon() || !m_DBTableGuid || (m_creatureData && !m_creatureData->dbData))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (m_respawnTime > time(NULL)) // dead (no corpse)
|
if (m_respawnTime > time(NULL)) // dead (no corpse)
|
||||||
@@ -2321,7 +2321,7 @@ uint32 Creature::GetVendorItemCurrentCount(VendorItem const* vItem)
|
|||||||
|
|
||||||
time_t ptime = time(NULL);
|
time_t ptime = time(NULL);
|
||||||
|
|
||||||
if (vCount->lastIncrementTime + vItem->incrtime <= ptime)
|
if (time_t(vCount->lastIncrementTime + vItem->incrtime) <= ptime)
|
||||||
{
|
{
|
||||||
ItemPrototype const* pProto = sObjectMgr.GetItemPrototype(vItem->item);
|
ItemPrototype const* pProto = sObjectMgr.GetItemPrototype(vItem->item);
|
||||||
|
|
||||||
@@ -2351,7 +2351,7 @@ uint32 Creature::UpdateVendorItemCurrentCount(VendorItem const* vItem, uint32 us
|
|||||||
|
|
||||||
if (itr == m_vendorItemCounts.end())
|
if (itr == m_vendorItemCounts.end())
|
||||||
{
|
{
|
||||||
int32 new_count = vItem->maxcount > used_count ? vItem->maxcount-used_count : 0;
|
uint32 new_count = vItem->maxcount > used_count ? vItem->maxcount-used_count : 0;
|
||||||
m_vendorItemCounts.push_back(VendorItemCount(vItem->item,new_count));
|
m_vendorItemCounts.push_back(VendorItemCount(vItem->item,new_count));
|
||||||
return new_count;
|
return new_count;
|
||||||
}
|
}
|
||||||
@@ -2386,11 +2386,12 @@ const char* Creature::GetNameForLocaleIdx(int32 loc_idx) const
|
|||||||
{
|
{
|
||||||
if (loc_idx >= 0)
|
if (loc_idx >= 0)
|
||||||
{
|
{
|
||||||
|
uint8 uloc_idx = uint8(loc_idx);
|
||||||
CreatureLocale const *cl = sObjectMgr.GetCreatureLocale(GetEntry());
|
CreatureLocale const *cl = sObjectMgr.GetCreatureLocale(GetEntry());
|
||||||
if (cl)
|
if (cl)
|
||||||
{
|
{
|
||||||
if (cl->Name.size() > loc_idx && !cl->Name[loc_idx].empty())
|
if (cl->Name.size() > uloc_idx && !cl->Name[uloc_idx].empty())
|
||||||
return cl->Name[loc_idx].c_str();
|
return cl->Name[uloc_idx].c_str();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -311,7 +311,7 @@ struct VendorItem
|
|||||||
: item(_item), maxcount(_maxcount), incrtime(_incrtime), ExtendedCost(_ExtendedCost) {}
|
: item(_item), maxcount(_maxcount), incrtime(_incrtime), ExtendedCost(_ExtendedCost) {}
|
||||||
|
|
||||||
uint32 item;
|
uint32 item;
|
||||||
int32 maxcount; // 0 for infinity item amount
|
uint32 maxcount; // 0 for infinity item amount
|
||||||
uint32 incrtime; // time for restore items amount if maxcount != 0
|
uint32 incrtime; // time for restore items amount if maxcount != 0
|
||||||
uint32 ExtendedCost;
|
uint32 ExtendedCost;
|
||||||
|
|
||||||
|
|||||||
@@ -171,11 +171,14 @@ void PlayerMenu::SendGossipMenu(uint32 TitleTextId, uint64 objectGUID)
|
|||||||
data << uint8(0); // 3.3.3 changes icon: blue question or yellow exclamation
|
data << uint8(0); // 3.3.3 changes icon: blue question or yellow exclamation
|
||||||
std::string Title = pQuest->GetTitle();
|
std::string Title = pQuest->GetTitle();
|
||||||
|
|
||||||
int loc_idx = pSession->GetSessionDbLocaleIndex();
|
int8 loc_idx = pSession->GetSessionDbLocaleIndex();
|
||||||
if (loc_idx >= 0)
|
if (loc_idx >= 0)
|
||||||
|
{
|
||||||
|
uint8 uloc_idx = uint8(loc_idx);
|
||||||
if (QuestLocale const *ql = sObjectMgr.GetQuestLocale(questID))
|
if (QuestLocale const *ql = sObjectMgr.GetQuestLocale(questID))
|
||||||
if (ql->Title.size() > loc_idx && !ql->Title[loc_idx].empty())
|
if (ql->Title.size() > uloc_idx && !ql->Title[uloc_idx].empty())
|
||||||
Title = ql->Title[loc_idx];
|
Title = ql->Title[uloc_idx];
|
||||||
|
}
|
||||||
data << Title; // max 0x200
|
data << Title; // max 0x200
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -214,14 +217,15 @@ void PlayerMenu::SendPointOfInterest(uint32 poi_id)
|
|||||||
|
|
||||||
std::string icon_name = poi->icon_name;
|
std::string icon_name = poi->icon_name;
|
||||||
|
|
||||||
int loc_idx = pSession->GetSessionDbLocaleIndex();
|
int8 loc_idx = pSession->GetSessionDbLocaleIndex();
|
||||||
if (loc_idx >= 0)
|
if (loc_idx >= 0)
|
||||||
{
|
{
|
||||||
|
uint8 uloc_idx = uint8(loc_idx);
|
||||||
PointOfInterestLocale const *pl = sObjectMgr.GetPointOfInterestLocale(poi_id);
|
PointOfInterestLocale const *pl = sObjectMgr.GetPointOfInterestLocale(poi_id);
|
||||||
if (pl)
|
if (pl)
|
||||||
{
|
{
|
||||||
if (pl->IconName.size() > size_t(loc_idx) && !pl->IconName[loc_idx].empty())
|
if (pl->IconName.size() > uloc_idx && !pl->IconName[uloc_idx].empty())
|
||||||
icon_name = pl->IconName[loc_idx];
|
icon_name = pl->IconName[uloc_idx];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -268,18 +272,19 @@ void PlayerMenu::SendTalking(uint32 textID)
|
|||||||
Text_0[i]=pGossip->Options[i].Text_0;
|
Text_0[i]=pGossip->Options[i].Text_0;
|
||||||
Text_1[i]=pGossip->Options[i].Text_1;
|
Text_1[i]=pGossip->Options[i].Text_1;
|
||||||
}
|
}
|
||||||
int loc_idx = pSession->GetSessionDbLocaleIndex();
|
int8 loc_idx = pSession->GetSessionDbLocaleIndex();
|
||||||
if (loc_idx >= 0)
|
if (loc_idx >= 0)
|
||||||
{
|
{
|
||||||
|
uint8 uloc_idx = uint8(loc_idx);
|
||||||
NpcTextLocale const *nl = sObjectMgr.GetNpcTextLocale(textID);
|
NpcTextLocale const *nl = sObjectMgr.GetNpcTextLocale(textID);
|
||||||
if (nl)
|
if (nl)
|
||||||
{
|
{
|
||||||
for (int i=0; i<8; ++i)
|
for (int i=0; i<8; ++i)
|
||||||
{
|
{
|
||||||
if (nl->Text_0[i].size() > loc_idx && !nl->Text_0[i][loc_idx].empty())
|
if (nl->Text_0[i].size() > uloc_idx && !nl->Text_0[i][uloc_idx].empty())
|
||||||
Text_0[i]=nl->Text_0[i][loc_idx];
|
Text_0[i]=nl->Text_0[i][uloc_idx];
|
||||||
if (nl->Text_1[i].size() > loc_idx && !nl->Text_1[i][loc_idx].empty())
|
if (nl->Text_1[i].size() > uloc_idx && !nl->Text_1[i][uloc_idx].empty())
|
||||||
Text_1[i]=nl->Text_1[i][loc_idx];
|
Text_1[i]=nl->Text_1[i][uloc_idx];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -401,13 +406,14 @@ void PlayerMenu::SendQuestGiverQuestList(QEmote eEmote, const std::string& Title
|
|||||||
{
|
{
|
||||||
std::string title = pQuest->GetTitle();
|
std::string title = pQuest->GetTitle();
|
||||||
|
|
||||||
int loc_idx = pSession->GetSessionDbLocaleIndex();
|
int8 loc_idx = pSession->GetSessionDbLocaleIndex();
|
||||||
if (loc_idx >= 0)
|
if (loc_idx >= 0)
|
||||||
{
|
{
|
||||||
|
uint8 uloc_idx = uint8(loc_idx);
|
||||||
if (QuestLocale const *ql = sObjectMgr.GetQuestLocale(questID))
|
if (QuestLocale const *ql = sObjectMgr.GetQuestLocale(questID))
|
||||||
{
|
{
|
||||||
if (ql->Title.size() > (size_t)loc_idx && !ql->Title[loc_idx].empty())
|
if (ql->Title.size() > uloc_idx && !ql->Title[uloc_idx].empty())
|
||||||
title = ql->Title[loc_idx];
|
title = ql->Title[uloc_idx];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -442,20 +448,21 @@ void PlayerMenu::SendQuestGiverQuestDetails(Quest const *pQuest, uint64 npcGUID,
|
|||||||
std::string Objectives = pQuest->GetObjectives();
|
std::string Objectives = pQuest->GetObjectives();
|
||||||
std::string EndText = pQuest->GetEndText();
|
std::string EndText = pQuest->GetEndText();
|
||||||
|
|
||||||
int loc_idx = pSession->GetSessionDbLocaleIndex();
|
int8 loc_idx = pSession->GetSessionDbLocaleIndex();
|
||||||
if (loc_idx >= 0)
|
if (loc_idx >= 0)
|
||||||
{
|
{
|
||||||
|
uint8 uloc_idx = uint8(loc_idx);
|
||||||
QuestLocale const *ql = sObjectMgr.GetQuestLocale(pQuest->GetQuestId());
|
QuestLocale const *ql = sObjectMgr.GetQuestLocale(pQuest->GetQuestId());
|
||||||
if (ql)
|
if (ql)
|
||||||
{
|
{
|
||||||
if (ql->Title.size() > loc_idx && !ql->Title[loc_idx].empty())
|
if (ql->Title.size() > uloc_idx && !ql->Title[uloc_idx].empty())
|
||||||
Title=ql->Title[loc_idx];
|
Title=ql->Title[uloc_idx];
|
||||||
if (ql->Details.size() > loc_idx && !ql->Details[loc_idx].empty())
|
if (ql->Details.size() > uloc_idx && !ql->Details[uloc_idx].empty())
|
||||||
Details=ql->Details[loc_idx];
|
Details=ql->Details[uloc_idx];
|
||||||
if (ql->Objectives.size() > loc_idx && !ql->Objectives[loc_idx].empty())
|
if (ql->Objectives.size() > uloc_idx && !ql->Objectives[uloc_idx].empty())
|
||||||
Objectives=ql->Objectives[loc_idx];
|
Objectives=ql->Objectives[uloc_idx];
|
||||||
if (ql->EndText.size() > loc_idx && !ql->EndText[loc_idx].empty())
|
if (ql->EndText.size() > uloc_idx && !ql->EndText[uloc_idx].empty())
|
||||||
EndText=ql->EndText[loc_idx];
|
EndText=ql->EndText[uloc_idx];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -566,23 +573,24 @@ void PlayerMenu::SendQuestQueryResponse(Quest const *pQuest)
|
|||||||
int loc_idx = pSession->GetSessionDbLocaleIndex();
|
int loc_idx = pSession->GetSessionDbLocaleIndex();
|
||||||
if (loc_idx >= 0)
|
if (loc_idx >= 0)
|
||||||
{
|
{
|
||||||
|
uint8 uloc_idx = uint8(loc_idx);
|
||||||
QuestLocale const *ql = sObjectMgr.GetQuestLocale(pQuest->GetQuestId());
|
QuestLocale const *ql = sObjectMgr.GetQuestLocale(pQuest->GetQuestId());
|
||||||
if (ql)
|
if (ql)
|
||||||
{
|
{
|
||||||
if (ql->Title.size() > loc_idx && !ql->Title[loc_idx].empty())
|
if (ql->Title.size() > uloc_idx && !ql->Title[uloc_idx].empty())
|
||||||
Title=ql->Title[loc_idx];
|
Title=ql->Title[uloc_idx];
|
||||||
if (ql->Details.size() > loc_idx && !ql->Details[loc_idx].empty())
|
if (ql->Details.size() > uloc_idx && !ql->Details[uloc_idx].empty())
|
||||||
Details=ql->Details[loc_idx];
|
Details=ql->Details[uloc_idx];
|
||||||
if (ql->Objectives.size() > loc_idx && !ql->Objectives[loc_idx].empty())
|
if (ql->Objectives.size() > uloc_idx && !ql->Objectives[uloc_idx].empty())
|
||||||
Objectives=ql->Objectives[loc_idx];
|
Objectives=ql->Objectives[uloc_idx];
|
||||||
if (ql->EndText.size() > loc_idx && !ql->EndText[loc_idx].empty())
|
if (ql->EndText.size() > uloc_idx && !ql->EndText[uloc_idx].empty())
|
||||||
EndText=ql->EndText[loc_idx];
|
EndText=ql->EndText[uloc_idx];
|
||||||
if (ql->CompletedText.size() > (size_t)loc_idx && !ql->CompletedText[loc_idx].empty())
|
if (ql->CompletedText.size() > uloc_idx && !ql->CompletedText[uloc_idx].empty())
|
||||||
CompletedText=ql->CompletedText[loc_idx];
|
CompletedText=ql->CompletedText[uloc_idx];
|
||||||
|
|
||||||
for (int i=0; i<QUEST_OBJECTIVES_COUNT; ++i)
|
for (int i=0; i<QUEST_OBJECTIVES_COUNT; ++i)
|
||||||
if (ql->ObjectiveText[i].size() > loc_idx && !ql->ObjectiveText[i][loc_idx].empty())
|
if (ql->ObjectiveText[i].size() > uloc_idx && !ql->ObjectiveText[i][uloc_idx].empty())
|
||||||
ObjectiveText[i]=ql->ObjectiveText[i][loc_idx];
|
ObjectiveText[i]=ql->ObjectiveText[i][uloc_idx];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -706,13 +714,14 @@ void PlayerMenu::SendQuestGiverOfferReward(Quest const* pQuest, uint64 npcGUID,
|
|||||||
int loc_idx = pSession->GetSessionDbLocaleIndex();
|
int loc_idx = pSession->GetSessionDbLocaleIndex();
|
||||||
if (loc_idx >= 0)
|
if (loc_idx >= 0)
|
||||||
{
|
{
|
||||||
|
uint8 uloc_idx = uint8(loc_idx);
|
||||||
QuestLocale const *ql = sObjectMgr.GetQuestLocale(pQuest->GetQuestId());
|
QuestLocale const *ql = sObjectMgr.GetQuestLocale(pQuest->GetQuestId());
|
||||||
if (ql)
|
if (ql)
|
||||||
{
|
{
|
||||||
if (ql->Title.size() > loc_idx && !ql->Title[loc_idx].empty())
|
if (ql->Title.size() > uloc_idx && !ql->Title[uloc_idx].empty())
|
||||||
Title=ql->Title[loc_idx];
|
Title=ql->Title[uloc_idx];
|
||||||
if (ql->OfferRewardText.size() > loc_idx && !ql->OfferRewardText[loc_idx].empty())
|
if (ql->OfferRewardText.size() > uloc_idx && !ql->OfferRewardText[uloc_idx].empty())
|
||||||
OfferRewardText=ql->OfferRewardText[loc_idx];
|
OfferRewardText=ql->OfferRewardText[uloc_idx];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -809,13 +818,14 @@ void PlayerMenu::SendQuestGiverRequestItems(Quest const *pQuest, uint64 npcGUID,
|
|||||||
int loc_idx = pSession->GetSessionDbLocaleIndex();
|
int loc_idx = pSession->GetSessionDbLocaleIndex();
|
||||||
if (loc_idx >= 0)
|
if (loc_idx >= 0)
|
||||||
{
|
{
|
||||||
|
uint8 uloc_idx = uint8(loc_idx);
|
||||||
QuestLocale const *ql = sObjectMgr.GetQuestLocale(pQuest->GetQuestId());
|
QuestLocale const *ql = sObjectMgr.GetQuestLocale(pQuest->GetQuestId());
|
||||||
if (ql)
|
if (ql)
|
||||||
{
|
{
|
||||||
if (ql->Title.size() > loc_idx && !ql->Title[loc_idx].empty())
|
if (ql->Title.size() > uloc_idx && !ql->Title[uloc_idx].empty())
|
||||||
Title=ql->Title[loc_idx];
|
Title=ql->Title[uloc_idx];
|
||||||
if (ql->RequestItemsText.size() > loc_idx && !ql->RequestItemsText[loc_idx].empty())
|
if (ql->RequestItemsText.size() > uloc_idx && !ql->RequestItemsText[uloc_idx].empty())
|
||||||
RequestItemsText=ql->RequestItemsText[loc_idx];
|
RequestItemsText=ql->RequestItemsText[uloc_idx];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user