diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/AI/SmartScripts/SmartScript.cpp | 4 | ||||
-rw-r--r-- | src/server/game/Scripting/ScriptMgr.cpp | 3 | ||||
-rw-r--r-- | src/server/game/Server/Packets/TicketPackets.cpp | 5 | ||||
-rw-r--r-- | src/server/game/Spells/Spell.cpp | 2 | ||||
-rw-r--r-- | src/server/scripts/Spells/spell_mage.cpp | 2 | ||||
-rw-r--r-- | src/server/scripts/Spells/spell_pet.cpp | 56 |
6 files changed, 21 insertions, 51 deletions
diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index 108e5cedd09..b80e861c4df 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -3199,7 +3199,7 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui std::list<Creature*> list; me->GetCreatureListWithEntryInGrid(list, e.event.distance.entry, (float)e.event.distance.dist); - if (list.size() > 0) + if (!list.empty()) creature = list.front(); } @@ -3230,7 +3230,7 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui std::list<GameObject*> list; me->GetGameObjectListWithEntryInGrid(list, e.event.distance.entry, (float)e.event.distance.dist); - if (list.size() > 0) + if (!list.empty()) gameobject = list.front(); } diff --git a/src/server/game/Scripting/ScriptMgr.cpp b/src/server/game/Scripting/ScriptMgr.cpp index 735328a0f1f..dd996ee0f50 100644 --- a/src/server/game/Scripting/ScriptMgr.cpp +++ b/src/server/game/Scripting/ScriptMgr.cpp @@ -182,9 +182,8 @@ struct TSpellSummary uint8 Effects; // set of enum SelectEffect } *SpellSummary; -ScriptMgr::ScriptMgr() : _scriptCount(0) +ScriptMgr::ScriptMgr() : _scriptCount(0), _scheduledScripts(0) { - _scheduledScripts = 0; } ScriptMgr::~ScriptMgr() { } diff --git a/src/server/game/Server/Packets/TicketPackets.cpp b/src/server/game/Server/Packets/TicketPackets.cpp index c33511a0fc4..70ef53551da 100644 --- a/src/server/game/Server/Packets/TicketPackets.cpp +++ b/src/server/game/Server/Packets/TicketPackets.cpp @@ -203,10 +203,9 @@ WorldPackets::Ticket::SupportTicketSubmitComplaint::SupportTicketChatLine::Suppo Text = data.ReadString(textLength); } -WorldPackets::Ticket::SupportTicketSubmitComplaint::SupportTicketChatLine::SupportTicketChatLine(uint32 timestamp, std::string const& text) +WorldPackets::Ticket::SupportTicketSubmitComplaint::SupportTicketChatLine::SupportTicketChatLine(uint32 timestamp, std::string const& text) : + Timestamp(timestamp), Text(text) { - Timestamp = timestamp; - Text = text; } ByteBuffer& operator>>(ByteBuffer& data, WorldPackets::Ticket::SupportTicketSubmitComplaint::SupportTicketChatLine& line) diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index a307b60f76b..919f11a5db4 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -7229,7 +7229,7 @@ void Spell::CallScriptDestinationTargetSelectHandlers(SpellDestination& target, bool Spell::CheckScriptEffectImplicitTargets(uint32 effIndex, uint32 effIndexToCheck) { // Skip if there are not any script - if (!m_loadedScripts.size()) + if (m_loadedScripts.empty()) return true; for (std::list<SpellScript*>::iterator itr = m_loadedScripts.begin(); itr != m_loadedScripts.end(); ++itr) diff --git a/src/server/scripts/Spells/spell_mage.cpp b/src/server/scripts/Spells/spell_mage.cpp index c5e2deaac24..8105f7de5ff 100644 --- a/src/server/scripts/Spells/spell_mage.cpp +++ b/src/server/scripts/Spells/spell_mage.cpp @@ -1301,7 +1301,7 @@ class spell_mage_ring_of_frost : public SpellScriptLoader GetTarget()->GetAllMinionsByEntry(MinionList, GetSpellInfo()->GetEffect(EFFECT_0)->MiscValue); // Get the last summoned RoF, save it and despawn older ones - for (std::list<TempSummon*>::iterator itr = MinionList.begin(); itr != MinionList.end(); itr++) + for (std::list<TempSummon*>::iterator itr = MinionList.begin(); itr != MinionList.end(); ++itr) { TempSummon* summon = (*itr); diff --git a/src/server/scripts/Spells/spell_pet.cpp b/src/server/scripts/Spells/spell_pet.cpp index d8b63150e3c..9a7ebc9625c 100644 --- a/src/server/scripts/Spells/spell_pet.cpp +++ b/src/server/scripts/Spells/spell_pet.cpp @@ -392,9 +392,7 @@ public: if (pet->IsPet()) if (Unit* owner = pet->ToPet()->GetOwner()) { - float ownerBonus = 0.0f; - - ownerBonus = CalculatePct(owner->GetStat(STAT_INTELLECT), 30); + int32 const ownerBonus = CalculatePct(owner->GetStat(STAT_INTELLECT), 30); amount += ownerBonus; _tempBonus = ownerBonus; @@ -445,8 +443,7 @@ public: if (pet->IsPet()) if (Unit* owner = pet->ToPet()->GetOwner()) { - float ownerBonus = 0.0f; - ownerBonus = CalculatePct(owner->GetArmor(), 35); + int32 const ownerBonus = CalculatePct(owner->GetArmor(), 35); amount += ownerBonus; } } @@ -457,8 +454,7 @@ public: if (pet->IsPet()) if (Unit* owner = pet->ToPet()->GetOwner()) { - float ownerBonus = 0.0f; - ownerBonus = CalculatePct(owner->GetResistance(SPELL_SCHOOL_FIRE), 40); + int32 const ownerBonus = CalculatePct(owner->GetResistance(SPELL_SCHOOL_FIRE), 40); amount += ownerBonus; } } @@ -504,8 +500,7 @@ public: if (pet->IsPet()) if (Unit* owner = pet->ToPet()->GetOwner()) { - float ownerBonus = 0.0f; - ownerBonus = CalculatePct(owner->GetResistance(SPELL_SCHOOL_FROST), 40); + int32 const ownerBonus = CalculatePct(owner->GetResistance(SPELL_SCHOOL_FROST), 40); amount += ownerBonus; } } @@ -516,8 +511,7 @@ public: if (pet->IsPet()) if (Unit* owner = pet->ToPet()->GetOwner()) { - float ownerBonus = 0.0f; - ownerBonus = CalculatePct(owner->GetResistance(SPELL_SCHOOL_ARCANE), 40); + int32 const ownerBonus = CalculatePct(owner->GetResistance(SPELL_SCHOOL_ARCANE), 40); amount += ownerBonus; } } @@ -528,8 +522,7 @@ public: if (pet->IsPet()) if (Unit* owner = pet->ToPet()->GetOwner()) { - float ownerBonus = 0.0f; - ownerBonus = CalculatePct(owner->GetResistance(SPELL_SCHOOL_NATURE), 40); + int32 const ownerBonus = CalculatePct(owner->GetResistance(SPELL_SCHOOL_NATURE), 40); amount += ownerBonus; } } @@ -570,8 +563,7 @@ public: if (pet->IsPet()) if (Unit* owner = pet->ToPet()->GetOwner()) { - float ownerBonus = 0.0f; - ownerBonus = CalculatePct(owner->GetResistance(SPELL_SCHOOL_SHADOW), 40); + int32 const ownerBonus = CalculatePct(owner->GetResistance(SPELL_SCHOOL_SHADOW), 40); amount += ownerBonus; } } @@ -906,7 +898,6 @@ public: if (Unit* owner = pet->ToPet()->GetOwner()) { float mod = 0.45f; - float ownerBonus = 0.0f; PetSpellMap::const_iterator itr = (pet->ToPet()->m_spells.find(62758)); // Wild Hunt rank 1 if (itr == pet->ToPet()->m_spells.end()) @@ -918,8 +909,7 @@ public: AddPct(mod, spellInfo->GetEffect(EFFECT_0)->CalcValue()); } - ownerBonus = owner->GetStat(STAT_STAMINA)*mod; - + int32 const ownerBonus = owner->GetStat(STAT_STAMINA) * mod; amount += ownerBonus; } } @@ -1043,10 +1033,7 @@ public: if (!owner) return; - float ownerBonus = 0.0f; - - ownerBonus = CalculatePct(owner->GetResistance(SPELL_SCHOOL_FROST), 40); - + int32 const ownerBonus = CalculatePct(owner->GetResistance(SPELL_SCHOOL_FROST), 40); amount += ownerBonus; } } @@ -1062,10 +1049,7 @@ public: if (!owner) return; - float ownerBonus = 0.0f; - - ownerBonus = CalculatePct(owner->GetResistance(SPELL_SCHOOL_FIRE), 40); - + int32 const ownerBonus = CalculatePct(owner->GetResistance(SPELL_SCHOOL_FIRE), 40); amount += ownerBonus; } } @@ -1081,10 +1065,7 @@ public: if (!owner) return; - float ownerBonus = 0.0f; - - ownerBonus = CalculatePct(owner->GetResistance(SPELL_SCHOOL_NATURE), 40); - + int32 const ownerBonus = CalculatePct(owner->GetResistance(SPELL_SCHOOL_NATURE), 40); amount += ownerBonus; } } @@ -1130,10 +1111,7 @@ public: if (!owner) return; - float ownerBonus = 0.0f; - - ownerBonus = CalculatePct(owner->GetResistance(SPELL_SCHOOL_SHADOW), 40); - + int32 const ownerBonus = CalculatePct(owner->GetResistance(SPELL_SCHOOL_SHADOW), 40); amount += ownerBonus; } } @@ -1149,10 +1127,7 @@ public: if (!owner) return; - float ownerBonus = 0.0f; - - ownerBonus = CalculatePct(owner->GetResistance(SPELL_SCHOOL_ARCANE), 40); - + int32 const ownerBonus = CalculatePct(owner->GetResistance(SPELL_SCHOOL_ARCANE), 40); amount += ownerBonus; } } @@ -1168,10 +1143,7 @@ public: if (!owner) return; - float ownerBonus = 0.0f; - - ownerBonus = CalculatePct(owner->GetArmor(), 35); - + int32 const ownerBonus = CalculatePct(owner->GetArmor(), 35); amount += ownerBonus; } } |