aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjoschiwald <joschiwald.trinity@gmail.com>2014-12-29 01:32:55 +0100
committerjoschiwald <joschiwald.trinity@gmail.com>2014-12-29 01:32:55 +0100
commite8f97ec80a0ca0a1cf55aa5e2a2fd9a43ec19766 (patch)
treee148896e0d846bcc49f13fffa5e4db75fd87192b
parent9ecc578cb187cc1ae0fd454883dab0cd058d3807 (diff)
Core: fixed typos from previous commit and kill more warnings
-rw-r--r--src/server/game/DataStores/DB2Stores.cpp2
-rw-r--r--src/server/game/DataStores/DBCStores.cpp4
-rw-r--r--src/server/game/Server/Packets/SpellPackets.cpp10
-rw-r--r--src/server/game/Server/Packets/SpellPackets.h7
-rw-r--r--src/server/game/Spells/Spell.cpp8
-rw-r--r--src/server/game/Spells/SpellEffects.cpp6
6 files changed, 22 insertions, 15 deletions
diff --git a/src/server/game/DataStores/DB2Stores.cpp b/src/server/game/DataStores/DB2Stores.cpp
index f27e48f71ff..708bb0cccd1 100644
--- a/src/server/game/DataStores/DB2Stores.cpp
+++ b/src/server/game/DataStores/DB2Stores.cpp
@@ -66,7 +66,7 @@ inline void LoadDB2(uint32& availableDb2Locales, DB2StoreProblemList& errlist, D
{
// compatibility format and C++ structure sizes
ASSERT(DB2FileLoader::GetFormatRecordSize(storage.GetFormat()) == sizeof(T),
- "Size of '%s' set by format string (" SZFMTD ") not equal size of C++ structure (%u).",
+ "Size of '%s' set by format string (%u) not equal size of C++ structure (" SZFMTD ").",
filename.c_str(), DB2FileLoader::GetFormatRecordSize(storage.GetFormat()), sizeof(T));
++DB2FilesCount;
diff --git a/src/server/game/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp
index 31d9cfa7e4e..ee2a604a49a 100644
--- a/src/server/game/DataStores/DBCStores.cpp
+++ b/src/server/game/DataStores/DBCStores.cpp
@@ -504,7 +504,7 @@ void LoadDBCStores(const std::string& dataPath)
LoadDBC(availableDbcLocales, bad_dbc_files, sNameGenStore, dbcPath, "NameGen.dbc"); // 19116
for (uint32 i = 0; i < sNameGenStore.GetNumRows(); ++i)
if (NameGenEntry const* entry = sNameGenStore.LookupEntry(i))
- sGenerateNamesMap[entry->Race].Contents[entry->Sex].push_back(std::string(entry->Name));
+ sGenerateNamesMap[entry->Race].Contents[entry->Sex].emplace_back(entry->Name);
sNameGenStore.Clear();
LoadDBC(availableDbcLocales, bad_dbc_files, sMovieStore, dbcPath, "Movie.dbc");//19116
@@ -1150,7 +1150,7 @@ std::list<uint32> GetSpellsForLevels(uint32 classId, uint32 raceMask, uint32 spe
if (specIter != sSpecializationSpellsBySpecStore.end())
{
SpecializationSpellsBySpecEntry learnSpellList = specIter->second;
- for (int i = 0; i < learnSpellList.size(); i++)
+ for (size_t i = 0; i < learnSpellList.size(); ++i)
{
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(learnSpellList[i]->SpellID);
if (!spellInfo)
diff --git a/src/server/game/Server/Packets/SpellPackets.cpp b/src/server/game/Server/Packets/SpellPackets.cpp
index 233c35f7bbd..0f68a37799e 100644
--- a/src/server/game/Server/Packets/SpellPackets.cpp
+++ b/src/server/game/Server/Packets/SpellPackets.cpp
@@ -231,15 +231,13 @@ void WorldPackets::Spells::SpellCastRequest::Read()
_worldPacket >> movementInfo;
}
- // SpellWeight
for (uint32 i = 0; i < SpellWeightCount; ++i)
{
_worldPacket.ResetBitPos();
- uint32 Type = _worldPacket.ReadBits(2);
- uint32 ID;
- _worldPacket >> ID;
- uint32 Quantity;
- _worldPacket >> Quantity;
+ SpellWeight unused;
+ unused.Type = _worldPacket.ReadBits(2);
+ _worldPacket >> unused.ID;
+ _worldPacket >> unused.Quantity;
}
}
diff --git a/src/server/game/Server/Packets/SpellPackets.h b/src/server/game/Server/Packets/SpellPackets.h
index 18d3df5b00d..f5351cad4e3 100644
--- a/src/server/game/Server/Packets/SpellPackets.h
+++ b/src/server/game/Server/Packets/SpellPackets.h
@@ -125,6 +125,13 @@ namespace WorldPackets
class SpellCastRequest final : public ClientPacket
{
public:
+ struct SpellWeight
+ {
+ uint32 Type = 0;
+ int32 ID = 0;
+ uint32 Quantity = 0;
+ };
+
SpellCastRequest(WorldPacket&& packet) : ClientPacket(std::move(packet))
{
ASSERT(packet.GetOpcode() == CMSG_CAST_SPELL || packet.GetOpcode() == CMSG_PET_CAST_SPELL);
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index 72653d700ec..d38181daab9 100644
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -4773,7 +4773,7 @@ void Spell::TakeReagents()
// if CastItem is also spell reagent
if (castItemTemplate && castItemTemplate->GetId() == itemid)
{
- for (int s = 0; s < castItemTemplate->Effects.size(); ++s)
+ for (uint8 s = 0; s < castItemTemplate->Effects.size(); ++s)
{
// CastItem will be used up and does not count as reagent
int32 charges = m_CastItem->GetSpellCharges(s);
@@ -6516,7 +6516,7 @@ SpellCastResult Spell::CheckItems()
if (Item* pitem = player->GetItemByEntry(item_id))
{
- for (int x = 0; x < pProto->Effects.size(); ++x)
+ for (uint8 x = 0; x < pProto->Effects.size(); ++x)
if (pProto->Effects[x].Charges != 0 && pitem->GetSpellCharges(x) == pProto->Effects[x].Charges)
return SPELL_FAILED_ITEM_AT_MAX_CHARGES;
}
@@ -6813,7 +6813,7 @@ bool Spell::CheckEffectTarget(GameObject const* target, SpellEffectInfo const* e
return true;
}
-bool Spell::CheckEffectTarget(Item const* target, SpellEffectInfo const* effect) const
+bool Spell::CheckEffectTarget(Item const* /*target*/, SpellEffectInfo const* effect) const
{
if (!effect->IsEffect())
return false;
@@ -7150,6 +7150,8 @@ void Spell::SetSpellValue(SpellValueMod mod, int32 value)
case SPELLVALUE_AURA_STACK:
m_spellValue->AuraStackAmount = uint8(value);
break;
+ default:
+ break;
}
}
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp
index 039bd5784d5..812055e18d4 100644
--- a/src/server/game/Spells/SpellEffects.cpp
+++ b/src/server/game/Spells/SpellEffects.cpp
@@ -912,7 +912,7 @@ void Spell::EffectTriggerRitualOfSummoning(SpellEffIndex /*effIndex*/)
m_caster->CastSpell((Unit*)NULL, spellInfo, false);
}
-void Spell::EffectJump(SpellEffIndex effIndex)
+void Spell::EffectJump(SpellEffIndex /*effIndex*/)
{
if (effectHandleMode != SPELL_EFFECT_HANDLE_LAUNCH_TARGET)
return;
@@ -931,7 +931,7 @@ void Spell::EffectJump(SpellEffIndex effIndex)
m_caster->GetMotionMaster()->MoveJump(x, y, z, speedXY, speedZ);
}
-void Spell::EffectJumpDest(SpellEffIndex effIndex)
+void Spell::EffectJumpDest(SpellEffIndex /*effIndex*/)
{
if (effectHandleMode != SPELL_EFFECT_HANDLE_LAUNCH)
return;
@@ -5641,7 +5641,7 @@ void Spell::EffectRechargeManaGem(SpellEffIndex /*effIndex*/)
if (Item* pItem = player->GetItemByEntry(item_id))
{
- for (int x = 0; x < pProto->Effects.size(); ++x)
+ for (size_t x = 0; x < pProto->Effects.size(); ++x)
pItem->SetSpellCharges(x, pProto->Effects[x].Charges);
pItem->SetState(ITEM_CHANGED, player);
}