Core: Fixed uninitialized variable warnings

--HG--
branch : trunk
This commit is contained in:
Shauren
2010-12-14 15:58:45 +01:00
parent 0c04b178db
commit f4581f67b8
6 changed files with 12 additions and 8 deletions
+4 -3
View File
@@ -1036,8 +1036,8 @@ valid examples:
int32 propertyId = 0;
bool negativeNumber = false;
char c;
for (uint8 i=0; i<randomPropertyPosition; ++i)
char c = '\0';
for (uint8 i = 0; i < randomPropertyPosition; ++i)
{
propertyId = 0;
negativeNumber = false;
@@ -1053,6 +1053,7 @@ valid examples:
return false;
}
}
if (negativeNumber)
propertyId *= -1;
@@ -1070,7 +1071,7 @@ valid examples:
}
// ignore other integers
while ((c >='0' && c <= '9') || c == ':')
while ((c >= '0' && c <= '9') || c == ':')
{
reader.ignore(1);
c = reader.peek();
+1 -1
View File
@@ -4410,7 +4410,7 @@ bool ChatHandler::HandleChannelSetOwnership(const char *args)
return false;
Player *player = m_session->GetPlayer();
Channel *chn;
Channel *chn = NULL;
if (ChannelMgr* cMgr = channelMgr(player->GetTeam()))
chn = cMgr->GetChannel(channel, player);
+4 -1
View File
@@ -435,6 +435,7 @@ void LoadDBCStores(const std::string& dataPath)
continue;
SpellDifficultyEntry newEntry;
memset(newEntry.SpellID, 0, 4*sizeof(uint32));
for (int x = 0; x < MAX_DIFFICULTY; ++x)
{
if (spellDiff->SpellID[x] <= 0 || !sSpellStore.LookupEntry(spellDiff->SpellID[x]))
@@ -442,7 +443,9 @@ void LoadDBCStores(const std::string& dataPath)
if (spellDiff->SpellID[x] > 0)//don't show error if spell is <= 0, not all modes have spells and there are unknown negative values
sLog.outErrorDb("spelldifficulty_dbc: spell %i at field id:%u at spellid%i does not exist in SpellStore (spell.dbc), loaded as 0", spellDiff->SpellID[x], spellDiff->ID, x);
newEntry.SpellID[x] = 0;//spell was <= 0 or invalid, set to 0
} else newEntry.SpellID[x] = spellDiff->SpellID[x];
}
else
newEntry.SpellID[x] = spellDiff->SpellID[x];
}
if (newEntry.SpellID[0] <= 0 || newEntry.SpellID[1] <= 0)//id0-1 must be always set!
continue;
+1 -1
View File
@@ -19767,7 +19767,7 @@ void Player::InitDisplayIds()
inline bool Player::_StoreOrEquipNewItem(uint32 vendorslot, uint32 item, uint8 count, uint8 bag, uint8 slot, int32 price, ItemPrototype const *pProto, Creature *pVendor, VendorItem const* crItem, bool bStore)
{
ItemPosCountVec vDest;
uint16 uiDest;
uint16 uiDest = 0;
uint8 msg = bStore ?
CanStoreNewItem(bag, slot, vDest, item, pProto->BuyCount * count) :
CanEquipNewItem(slot, uiDest, item, false);
+1 -1
View File
@@ -828,7 +828,7 @@ void Map::ScriptsProcess()
break;
}
Creature* cTarget;
Creature* cTarget = NULL;
if (source) //using grid searcher
{
WorldObject* wSource = dynamic_cast <WorldObject*> (source);
@@ -187,7 +187,7 @@ void WorldSession::HandleLfgPlayerLockInfoRequestOpcode(WorldPacket &/*recv_data
{
LfgReward const* reward = NULL;
Quest const* qRew = NULL;
uint8 done;
uint8 done = 0;
data << uint8(randomDungeons.size()); // Random Dungeon count
for (LfgDungeonSet::iterator it = randomDungeons.begin(); it != randomDungeons.end(); ++it)