aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xsrc/server/game/Chat/Chat.cpp7
-rwxr-xr-xsrc/server/game/Chat/Commands/Level3.cpp2
-rwxr-xr-xsrc/server/game/DataStores/DBCStores.cpp5
-rwxr-xr-xsrc/server/game/Entities/Player/Player.cpp2
-rwxr-xr-xsrc/server/game/Scripting/MapScripts.cpp2
-rwxr-xr-xsrc/server/game/Server/Protocol/Handlers/LFGHandler.cpp2
6 files changed, 12 insertions, 8 deletions
diff --git a/src/server/game/Chat/Chat.cpp b/src/server/game/Chat/Chat.cpp
index 472ae27b735..5f381e5468b 100755
--- a/src/server/game/Chat/Chat.cpp
+++ b/src/server/game/Chat/Chat.cpp
@@ -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();
diff --git a/src/server/game/Chat/Commands/Level3.cpp b/src/server/game/Chat/Commands/Level3.cpp
index 5c321be6e08..d1cb5c98bc0 100755
--- a/src/server/game/Chat/Commands/Level3.cpp
+++ b/src/server/game/Chat/Commands/Level3.cpp
@@ -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);
diff --git a/src/server/game/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp
index 1f82f96dac6..9966ac6afd0 100755
--- a/src/server/game/DataStores/DBCStores.cpp
+++ b/src/server/game/DataStores/DBCStores.cpp
@@ -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;
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index de27ab30628..2f1cb394578 100755
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -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);
diff --git a/src/server/game/Scripting/MapScripts.cpp b/src/server/game/Scripting/MapScripts.cpp
index 87fc78de91d..88eb795c554 100755
--- a/src/server/game/Scripting/MapScripts.cpp
+++ b/src/server/game/Scripting/MapScripts.cpp
@@ -828,7 +828,7 @@ void Map::ScriptsProcess()
break;
}
- Creature* cTarget;
+ Creature* cTarget = NULL;
if (source) //using grid searcher
{
WorldObject* wSource = dynamic_cast <WorldObject*> (source);
diff --git a/src/server/game/Server/Protocol/Handlers/LFGHandler.cpp b/src/server/game/Server/Protocol/Handlers/LFGHandler.cpp
index e0a58aa029d..399dabc2103 100755
--- a/src/server/game/Server/Protocol/Handlers/LFGHandler.cpp
+++ b/src/server/game/Server/Protocol/Handlers/LFGHandler.cpp
@@ -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)