aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorariel- <ariel-@users.noreply.github.com>2017-04-09 19:18:22 -0300
committerariel- <ariel-@users.noreply.github.com>2017-04-09 19:18:22 -0300
commite478434146fd479fab955aaa80eb925c15e29809 (patch)
tree2a9a11522c188a8321317987dad8ed4ce7c469a0 /src
parent214b8e53c5598695915c1392702e059d79cfc260 (diff)
Core/Misc: fix static analysis issues
CID 1373466 CID 1373481 CID 1373482
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Entities/Unit/Unit.cpp2
-rw-r--r--src/server/game/Handlers/CharacterHandler.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp8
3 files changed, 4 insertions, 10 deletions
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index 87d7bd7e9c2..4d07634a97a 100644
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -1712,7 +1712,7 @@ uint32 Unit::CalcSpellResistedDamage(Unit* victim, uint32 damage, SpellSchoolMas
while (r >= probabilitySum && resistance < 10)
probabilitySum += discreteResistProbability[++resistance];
- float damageResisted = float(damage * resistance / 10);
+ float damageResisted = damage * resistance / 10.f;
if (damageResisted > 0.0f) // if any damage was resisted
{
int32 ignoredResistance = 0;
diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp
index db482b05b5d..bd71f39a447 100644
--- a/src/server/game/Handlers/CharacterHandler.cpp
+++ b/src/server/game/Handlers/CharacterHandler.cpp
@@ -1988,8 +1988,8 @@ void WorldSession::HandleCharFactionOrRaceChangeCallback(std::shared_ptr<Charact
uint32 title_alliance = it->first;
uint32 title_horde = it->second;
- CharTitlesEntry const* atitleInfo = sCharTitlesStore.LookupEntry(title_alliance);
- CharTitlesEntry const* htitleInfo = sCharTitlesStore.LookupEntry(title_horde);
+ CharTitlesEntry const* atitleInfo = sCharTitlesStore.AssertEntry(title_alliance);
+ CharTitlesEntry const* htitleInfo = sCharTitlesStore.AssertEntry(title_horde);
// new team
if (newTeam == ALLIANCE)
{
diff --git a/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp b/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp
index eb65bf1dfb3..6a200a8089b 100644
--- a/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp
+++ b/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp
@@ -553,12 +553,6 @@ class spell_collecting_fallout : public SpellScriptLoader
{
PrepareSpellScript(spell_collecting_fallout_SpellScript);
- bool Load() override
- {
- _spellFail = true;
- return true;
- }
-
void OnLaunch(SpellEffIndex effIndex)
{
// estimated 25% chance of success
@@ -580,7 +574,7 @@ class spell_collecting_fallout : public SpellScriptLoader
OnEffectLaunch += SpellEffectFn(spell_collecting_fallout_SpellScript::HandleFail, EFFECT_1, SPELL_EFFECT_TRIGGER_SPELL);
}
- bool _spellFail;
+ bool _spellFail = true;
};
SpellScript* GetSpellScript() const override