Core: More warning fixes
This commit is contained in:
@@ -301,7 +301,7 @@ bool Creature::InitEntry(uint32 Entry, uint32 /*team*/, const CreatureData *data
|
||||
}
|
||||
|
||||
uint32 displayID = sObjectMgr->ChooseDisplayId(0, GetCreatureInfo(), data);
|
||||
CreatureModelInfo const *minfo = sObjectMgr->GetCreatureModelRandomGender(displayID);
|
||||
CreatureModelInfo const *minfo = sObjectMgr->GetCreatureModelRandomGender(&displayID);
|
||||
if (!minfo) // Cancel load if no model defined
|
||||
{
|
||||
sLog->outErrorDb("Creature (Entry: %u) has no model defined in table `creature_template`, can't load. ", Entry);
|
||||
@@ -779,8 +779,8 @@ bool Creature::Create(uint32 guidlow, Map *map, uint32 phaseMask, uint32 Entry,
|
||||
}
|
||||
|
||||
LoadCreaturesAddon();
|
||||
uint32 displayID = 0;
|
||||
CreatureModelInfo const *minfo = sObjectMgr->GetCreatureModelRandomGender(displayID = GetNativeDisplayId());
|
||||
uint32 displayID = GetNativeDisplayId();
|
||||
CreatureModelInfo const *minfo = sObjectMgr->GetCreatureModelRandomGender(&displayID);
|
||||
if (minfo && !isTotem()) // Cancel load if no model defined or if totem
|
||||
{
|
||||
SetDisplayId(displayID);
|
||||
@@ -1618,8 +1618,8 @@ void Creature::Respawn(bool force)
|
||||
else
|
||||
setDeathState(JUST_ALIVED);
|
||||
|
||||
uint32 displayID = 0;
|
||||
CreatureModelInfo const *minfo = sObjectMgr->GetCreatureModelRandomGender(displayID = GetNativeDisplayId());
|
||||
uint32 displayID = GetNativeDisplayId();
|
||||
CreatureModelInfo const *minfo = sObjectMgr->GetCreatureModelRandomGender(&displayID);
|
||||
if (minfo) // Cancel load if no model defined
|
||||
{
|
||||
SetDisplayId(displayID);
|
||||
|
||||
@@ -11150,7 +11150,6 @@ InventoryResult Player::CanStoreItems(Item** pItems, int count) const
|
||||
if (pItem->IsBindedNotWith(this))
|
||||
return EQUIP_ERR_DONT_OWN_THAT_ITEM;
|
||||
|
||||
Bag *pBag;
|
||||
ItemTemplate const *pBagProto;
|
||||
|
||||
// item is 'one item only'
|
||||
@@ -11201,11 +11200,11 @@ InventoryResult Player::CanStoreItems(Item** pItems, int count) const
|
||||
|
||||
for (int t = INVENTORY_SLOT_BAG_START; !b_found && t < INVENTORY_SLOT_BAG_END; ++t)
|
||||
{
|
||||
if (pBag = GetBagByPos(t))
|
||||
if (Bag* bag = GetBagByPos(t))
|
||||
{
|
||||
if (ItemCanGoIntoBag(pItem->GetTemplate(), pBag->GetTemplate()))
|
||||
if (ItemCanGoIntoBag(pItem->GetTemplate(), bag->GetTemplate()))
|
||||
{
|
||||
for (uint32 j = 0; j < pBag->GetBagSize(); j++)
|
||||
for (uint32 j = 0; j < bag->GetBagSize(); j++)
|
||||
{
|
||||
pItem2 = GetItemByPos(t, j);
|
||||
if( pItem2 && pItem2->CanBeMergedPartlyWith(pProto) == EQUIP_ERR_OK && inv_bags[t-INVENTORY_SLOT_BAG_START][j] + pItem->GetCount() <= pProto->GetMaxStackSize())
|
||||
@@ -11258,15 +11257,15 @@ InventoryResult Player::CanStoreItems(Item** pItems, int count) const
|
||||
|
||||
for (int t = INVENTORY_SLOT_BAG_START; !b_found && t < INVENTORY_SLOT_BAG_END; ++t)
|
||||
{
|
||||
if (pBag = GetBagByPos(t))
|
||||
if (Bag* bag = GetBagByPos(t))
|
||||
{
|
||||
pBagProto = pBag->GetTemplate();
|
||||
pBagProto = bag->GetTemplate();
|
||||
|
||||
// not plain container check
|
||||
if (pBagProto && (pBagProto->Class != ITEM_CLASS_CONTAINER || pBagProto->SubClass != ITEM_SUBCLASS_CONTAINER) &&
|
||||
ItemCanGoIntoBag(pProto, pBagProto))
|
||||
{
|
||||
for (uint32 j = 0; j < pBag->GetBagSize(); j++)
|
||||
for (uint32 j = 0; j < bag->GetBagSize(); j++)
|
||||
{
|
||||
if (inv_bags[t-INVENTORY_SLOT_BAG_START][j] == 0)
|
||||
{
|
||||
@@ -11297,15 +11296,15 @@ InventoryResult Player::CanStoreItems(Item** pItems, int count) const
|
||||
// search free slot in bags
|
||||
for (int t = INVENTORY_SLOT_BAG_START; !b_found && t < INVENTORY_SLOT_BAG_END; ++t)
|
||||
{
|
||||
if (pBag = GetBagByPos(t))
|
||||
if (Bag* bag = GetBagByPos(t))
|
||||
{
|
||||
pBagProto = pBag->GetTemplate();
|
||||
pBagProto = bag->GetTemplate();
|
||||
|
||||
// special bag already checked
|
||||
if (pBagProto && (pBagProto->Class != ITEM_CLASS_CONTAINER || pBagProto->SubClass != ITEM_SUBCLASS_CONTAINER))
|
||||
continue;
|
||||
|
||||
for (uint32 j = 0; j < pBag->GetBagSize(); j++)
|
||||
for (uint32 j = 0; j < bag->GetBagSize(); j++)
|
||||
{
|
||||
if (inv_bags[t-INVENTORY_SLOT_BAG_START][j] == 0)
|
||||
{
|
||||
|
||||
@@ -58,7 +58,7 @@ void Totem::InitStats(uint32 duration)
|
||||
if (m_owner->GetTypeId() == TYPEID_PLAYER && cinfo)
|
||||
{
|
||||
uint32 displayID = sObjectMgr->ChooseDisplayId(m_owner->ToPlayer()->GetTeam(), cinfo);
|
||||
CreatureModelInfo const *minfo = sObjectMgr->GetCreatureModelRandomGender(displayID);
|
||||
sObjectMgr->GetCreatureModelRandomGender(&displayID);
|
||||
switch (m_owner->ToPlayer()->GetTeam())
|
||||
{
|
||||
case ALLIANCE:
|
||||
|
||||
Reference in New Issue
Block a user