mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-22 02:04:52 +01:00
Core/Misc: Fix issues reported by static analysis
This commit is contained in:
@@ -197,9 +197,7 @@ public:
|
||||
|
||||
sObjectMgr->AddVendorItem(vendor_entry, itemId, maxcount, incrtime, extendedcost);
|
||||
|
||||
ItemTemplate const* itemTemplate = sObjectMgr->GetItemTemplate(itemId);
|
||||
|
||||
handler->PSendSysMessage(LANG_ITEM_ADDED_TO_LIST, itemId, itemTemplate->Name1.c_str(), maxcount, incrtime, extendedcost);
|
||||
handler->PSendSysMessage(LANG_ITEM_ADDED_TO_LIST, itemId, item->Name1.c_str(), maxcount, incrtime, extendedcost);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -351,9 +349,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
ItemTemplate const* itemTemplate = sObjectMgr->GetItemTemplate(itemId);
|
||||
|
||||
handler->PSendSysMessage(LANG_ITEM_DELETED_FROM_LIST, itemId, itemTemplate->Name1.c_str());
|
||||
handler->PSendSysMessage(LANG_ITEM_DELETED_FROM_LIST, itemId, item->Name1.c_str());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -204,7 +204,7 @@ class spell_ioc_launch : public SpellScript
|
||||
if (!GetCaster()->ToCreature() || !GetExplTargetDest())
|
||||
return;
|
||||
|
||||
GetCaster()->ToCreature()->m_Events.AddEvent(new StartLaunchEvent(*GetExplTargetDest(), GetHitPlayer()->GetGUID().GetCounter()), GetCaster()->ToCreature()->m_Events.CalculateTime(2500ms));
|
||||
GetCaster()->ToCreature()->m_Events.AddEvent(new StartLaunchEvent(*GetExplTargetDest(), ASSERT_NOTNULL(GetHitPlayer())->GetGUID().GetCounter()), GetCaster()->ToCreature()->m_Events.CalculateTime(2500ms));
|
||||
}
|
||||
|
||||
void Register() override
|
||||
|
||||
@@ -113,7 +113,7 @@ private:
|
||||
|
||||
struct npc_underbog_mushroom : public ScriptedAI
|
||||
{
|
||||
npc_underbog_mushroom(Creature* creature) : ScriptedAI(creature) { }
|
||||
npc_underbog_mushroom(Creature* creature) : ScriptedAI(creature), _counter(0) { }
|
||||
|
||||
void InitializeAI() override
|
||||
{
|
||||
@@ -154,7 +154,7 @@ struct npc_underbog_mushroom : public ScriptedAI
|
||||
|
||||
private:
|
||||
TaskScheduler _scheduler;
|
||||
uint32 _counter = 0;
|
||||
uint32 _counter;
|
||||
};
|
||||
|
||||
void AddSC_boss_hungarfen()
|
||||
|
||||
@@ -2019,7 +2019,7 @@ class spell_dk_raise_dead : public SpellScriptLoader
|
||||
SpellCastResult CheckReagents()
|
||||
{
|
||||
/// @workaround: there is no access to castresult of other spells, check it manually
|
||||
SpellInfo const* reagentSpell = sSpellMgr->GetSpellInfo(SPELL_DK_RAISE_DEAD_USE_REAGENT);
|
||||
SpellInfo const* reagentSpell = sSpellMgr->AssertSpellInfo(SPELL_DK_RAISE_DEAD_USE_REAGENT);
|
||||
Player* player = GetCaster()->ToPlayer();
|
||||
if (!player->CanNoReagentCast(reagentSpell))
|
||||
{
|
||||
|
||||
@@ -143,7 +143,7 @@ class achievement_arena_kills : public AchievementCriteriaScript
|
||||
if (!source->InArena())
|
||||
return false;
|
||||
|
||||
return source->GetBattleground()->GetArenaType() == _arenaType;
|
||||
return ASSERT_NOTNULL(source->GetBattleground())->GetArenaType() == _arenaType;
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user