aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server/game/AI/SmartScripts/SmartAI.cpp4
-rw-r--r--src/server/game/AI/SmartScripts/SmartScriptMgr.h1
-rwxr-xr-xsrc/server/game/Battlegrounds/Battleground.cpp2
-rwxr-xr-xsrc/server/game/Battlegrounds/Zones/BattlegroundSA.cpp2
-rwxr-xr-xsrc/server/game/Chat/Chat.cpp4
-rwxr-xr-xsrc/server/game/Combat/ThreatManager.cpp2
-rwxr-xr-xsrc/server/game/DataStores/DBCStores.cpp4
-rwxr-xr-xsrc/server/game/Groups/Group.cpp2
-rwxr-xr-xsrc/server/game/Server/Protocol/Handlers/PetHandler.cpp2
-rwxr-xr-xsrc/server/game/Spells/Spell.cpp1
-rwxr-xr-xsrc/server/game/Spells/SpellEffects.cpp2
-rw-r--r--src/server/game/Tools/PlayerDump.cpp10
-rwxr-xr-xsrc/server/game/World/World.cpp2
13 files changed, 18 insertions, 20 deletions
diff --git a/src/server/game/AI/SmartScripts/SmartAI.cpp b/src/server/game/AI/SmartScripts/SmartAI.cpp
index 7305d41ec2d..97bfbd6fb10 100644
--- a/src/server/game/AI/SmartScripts/SmartAI.cpp
+++ b/src/server/game/AI/SmartScripts/SmartAI.cpp
@@ -235,7 +235,7 @@ void SmartAI::EndPath(bool fail)
}
}else
{
- for (ObjectList::iterator iter = targets->begin(); iter != targets->end(); iter++)
+ for (ObjectList::iterator iter = targets->begin(); iter != targets->end(); ++iter)
{
if (GetScript()->IsPlayer((*iter)))
{
@@ -401,7 +401,7 @@ bool SmartAI::IsEscortInvokerInRange()
}
}else
{
- for (ObjectList::iterator iter = targets->begin(); iter != targets->end(); iter++)
+ for (ObjectList::iterator iter = targets->begin(); iter != targets->end(); ++iter)
{
if (GetScript()->IsPlayer((*iter)))
{
diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.h b/src/server/game/AI/SmartScripts/SmartScriptMgr.h
index 30024c42932..d6235b05667 100644
--- a/src/server/game/AI/SmartScripts/SmartScriptMgr.h
+++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.h
@@ -1153,7 +1153,6 @@ struct SmartScriptHolder
runOnce = false;
link = 0;
entryOrGuid = 0;
- link = 0;
event_id = 0;
enableTimed = false;
}
diff --git a/src/server/game/Battlegrounds/Battleground.cpp b/src/server/game/Battlegrounds/Battleground.cpp
index 853215c7026..0090e910e8a 100755
--- a/src/server/game/Battlegrounds/Battleground.cpp
+++ b/src/server/game/Battlegrounds/Battleground.cpp
@@ -1664,7 +1664,7 @@ void Battleground::SendWarningToAll(int32 entry, ...)
data << (uint32)1;
data << (uint8)0;
data << (uint64)0;
- data << (uint32)(strlen(msg.c_str())+1);
+ data << (uint32)(msg.length() + 1);
data << msg.c_str();
data << (uint8)0;
for (BattlegroundPlayerMap::const_iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp
index 8f0e285f4bc..7ce7498358b 100755
--- a/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp
@@ -261,7 +261,7 @@ void BattlegroundSA::StartShips()
for (int i = BG_SA_BOAT_ONE; i <= BG_SA_BOAT_TWO; i++)
{
- for (BattlegroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end();itr++)
+ for (BattlegroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr)
{
if (Player* p = ObjectAccessor::FindPlayer(itr->first))
{
diff --git a/src/server/game/Chat/Chat.cpp b/src/server/game/Chat/Chat.cpp
index 9509302f87b..cecbd223ed9 100755
--- a/src/server/game/Chat/Chat.cpp
+++ b/src/server/game/Chat/Chat.cpp
@@ -653,7 +653,7 @@ bool ChatHandler::ExecuteCommandInTable(ChatCommand *table, const char* text, co
continue;
bool match = false;
- if (strlen(table[i].Name) > strlen(cmd.c_str()))
+ if (strlen(table[i].Name) > cmd.length())
{
for (uint32 j = 0; table[j].Name != NULL; ++j)
{
@@ -694,7 +694,7 @@ bool ChatHandler::ExecuteCommandInTable(ChatCommand *table, const char* text, co
SetSentErrorMessage(false);
// table[i].Name == "" is special case: send original command to handler
- if ((table[i].Handler)(this, strlen(table[i].Name) != 0 ? text : oldtext))
+ if ((table[i].Handler)(this, table[i].Name[0] != '\0' ? text : oldtext))
{
if (table[i].SecurityLevel > SEC_PLAYER)
{
diff --git a/src/server/game/Combat/ThreatManager.cpp b/src/server/game/Combat/ThreatManager.cpp
index 242110f4a22..bf3650f611e 100755
--- a/src/server/game/Combat/ThreatManager.cpp
+++ b/src/server/game/Combat/ThreatManager.cpp
@@ -301,7 +301,7 @@ HostileReference* ThreatContainer::selectNextVictim(Creature* attacker, HostileR
bool noPriorityTargetFound = false;
std::list<HostileReference*>::const_iterator lastRef = iThreatList.end();
- lastRef--;
+ --lastRef;
for (std::list<HostileReference*>::const_iterator iter = iThreatList.begin(); iter != iThreatList.end() && !found;)
{
diff --git a/src/server/game/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp
index b34ac0bc681..88477be6115 100755
--- a/src/server/game/DataStores/DBCStores.cpp
+++ b/src/server/game/DataStores/DBCStores.cpp
@@ -239,7 +239,7 @@ inline void LoadDBC(uint32& availableDbcLocales, StoreProblemList& errors, DBCSt
if (FILE* f = fopen(dbcFilename.c_str(), "rb"))
{
char buf[100];
- snprintf(buf, 100, " (exists, but has %d fields instead of " SIZEFMTD ") Possible wrong client version.", storage.GetFieldCount(), strlen(storage.GetFormat()));
+ snprintf(buf, 100, " (exists, but has %u fields instead of " SIZEFMTD ") Possible wrong client version.", storage.GetFieldCount(), strlen(storage.GetFormat()));
errors.push_back(dbcFilename + buf);
fclose(f);
}
@@ -363,7 +363,7 @@ void LoadDBCStores(const std::string& dataPath)
// fill data
for (uint32 i = 1; i < sMapDifficultyStore.GetNumRows(); ++i)
if (MapDifficultyEntry const* entry = sMapDifficultyStore.LookupEntry(i))
- sMapDifficultyMap[MAKE_PAIR32(entry->MapId, entry->Difficulty)] = MapDifficulty(entry->resetTime, entry->maxPlayers, strlen(entry->areaTriggerText)>0);
+ sMapDifficultyMap[MAKE_PAIR32(entry->MapId, entry->Difficulty)] = MapDifficulty(entry->resetTime, entry->maxPlayers, entry->areaTriggerText[0] != '\0');
sMapDifficultyStore.Clear();
LoadDBC(availableDbcLocales, bad_dbc_files, sMovieStore, dbcPath, "Movie.dbc");
diff --git a/src/server/game/Groups/Group.cpp b/src/server/game/Groups/Group.cpp
index c26ffdd3190..52f94f10b40 100755
--- a/src/server/game/Groups/Group.cpp
+++ b/src/server/game/Groups/Group.cpp
@@ -1003,7 +1003,7 @@ void Group::EndRoll(Loot *pLoot)
itr = RollId.begin();
}
else
- itr++;
+ ++itr;
}
}
diff --git a/src/server/game/Server/Protocol/Handlers/PetHandler.cpp b/src/server/game/Server/Protocol/Handlers/PetHandler.cpp
index 53681540f86..67272f4d5ec 100755
--- a/src/server/game/Server/Protocol/Handlers/PetHandler.cpp
+++ b/src/server/game/Server/Protocol/Handlers/PetHandler.cpp
@@ -678,7 +678,7 @@ void WorldSession::HandlePetAbandon(WorldPacket & recv_data)
if (pet->GetGUID() == _player->GetPetGUID())
{
uint32 feelty = pet->GetPower(POWER_HAPPINESS);
- pet->SetPower(POWER_HAPPINESS , (feelty-50000) > 0 ?(feelty-50000) : 0);
+ pet->SetPower(POWER_HAPPINESS , feelty > 50000 ? (feelty-50000) : 0);
}
_player->RemovePet((Pet*)pet, PET_SAVE_AS_DELETED);
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index 15e0c1a9edf..3126c5fc8ad 100755
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -2497,7 +2497,6 @@ void Spell::SelectEffectTargets(uint32 i, SpellImplicitTargetInfo const& cur)
// Search for ghoul if our ghoul or dead body not valid unit target
if (!(m_targets.GetUnitTarget() && ((m_targets.GetUnitTarget()->GetEntry() == 26125 && m_targets.GetUnitTarget()->GetOwnerGUID() == m_caster->GetGUID())
|| (m_targets.GetUnitTarget()->getDeathState() == CORPSE
- && m_targets.GetUnitTarget()->GetDisplayId() == m_targets.GetUnitTarget()->GetNativeDisplayId()
&& m_targets.GetUnitTarget()->GetTypeId() == TYPEID_UNIT
&& !(m_targets.GetUnitTarget()->GetCreatureTypeMask() & CREATURE_TYPEMASK_MECHANICAL_OR_ELEMENTAL)
&& m_targets.GetUnitTarget()->GetDisplayId() == m_targets.GetUnitTarget()->GetNativeDisplayId()))))
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp
index 825c8c4fb14..9590d022ff8 100755
--- a/src/server/game/Spells/SpellEffects.cpp
+++ b/src/server/game/Spells/SpellEffects.cpp
@@ -999,7 +999,7 @@ void Spell::EffectDummy(SpellEffIndex effIndex)
}
case 47170: // Impale Leviroth
{
- if (!unitTarget && unitTarget->GetEntry() != 26452 && unitTarget->HealthAbovePct(95))
+ if (!unitTarget || (unitTarget->GetEntry() != 26452 && unitTarget->HealthAbovePct(95)))
return;
m_caster->DealDamage(unitTarget, unitTarget->CountPctFromMaxHealth(93));
diff --git a/src/server/game/Tools/PlayerDump.cpp b/src/server/game/Tools/PlayerDump.cpp
index 4c464f92606..7961c705d5b 100644
--- a/src/server/game/Tools/PlayerDump.cpp
+++ b/src/server/game/Tools/PlayerDump.cpp
@@ -176,7 +176,7 @@ bool changeGuid(std::string &str, int n, std::map<uint32, uint32> &guidMap, uint
return true; // not an error
uint32 newGuid = registerNewGuid(oldGuid, guidMap, hiGuid);
- snprintf(chritem, 20, "%d", newGuid);
+ snprintf(chritem, 20, "%u", newGuid);
return changenth(str, n, chritem, false, nonzero);
}
@@ -189,7 +189,7 @@ bool changetokGuid(std::string &str, int n, std::map<uint32, uint32> &guidMap, u
return true; // not an error
uint32 newGuid = registerNewGuid(oldGuid, guidMap, hiGuid);
- snprintf(chritem, 20, "%d", newGuid);
+ snprintf(chritem, 20, "%u", newGuid);
return changetoknth(str, n, chritem, false, nonzero);
}
@@ -421,9 +421,9 @@ DumpReturn PlayerDumpReader::LoadDump(const std::string& file, uint32 account, s
// name encoded or empty
- snprintf(newguid, 20, "%d", guid);
- snprintf(chraccount, 20, "%d", account);
- snprintf(newpetid, 20, "%d", sObjectMgr->GeneratePetNumber());
+ snprintf(newguid, 20, "%u", guid);
+ snprintf(chraccount, 20, "%u", account);
+ snprintf(newpetid, 20, "%u", sObjectMgr->GeneratePetNumber());
snprintf(lastpetid, 20, "%s", "");
std::map<uint32, uint32> items;
diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp
index 639af40fa1d..aa4ce9444ae 100755
--- a/src/server/game/World/World.cpp
+++ b/src/server/game/World/World.cpp
@@ -1754,7 +1754,7 @@ void World::DetectDBCLang()
uint8 default_locale = TOTAL_LOCALES;
for (uint8 i = default_locale-1; i < TOTAL_LOCALES; --i) // -1 will be 255 due to uint8
{
- if (strlen(race->name[i]) > 0) // check by race names
+ if (race->name[i][0] != '\0') // check by race names
{
default_locale = i;
m_availableDbcLocaleMask |= (1 << i);