mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-18 16:38:42 +01:00
Core/Misc: Fix issues reported by static analysis
(cherry picked from commit 33dace231c)
This commit is contained in:
@@ -206,9 +206,7 @@ public:
|
||||
|
||||
sObjectMgr->AddVendorItem(vendor_entry, vItem);
|
||||
|
||||
ItemTemplate const* itemTemplate = sObjectMgr->GetItemTemplate(itemId);
|
||||
|
||||
handler->PSendSysMessage(LANG_ITEM_ADDED_TO_LIST, itemId, itemTemplate->GetDefaultLocaleName(), maxcount, incrtime, extendedcost);
|
||||
handler->PSendSysMessage(LANG_ITEM_ADDED_TO_LIST, itemId, item->GetDefaultLocaleName(), maxcount, incrtime, extendedcost);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -360,9 +358,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
ItemTemplate const* itemTemplate = sObjectMgr->GetItemTemplate(itemId);
|
||||
|
||||
handler->PSendSysMessage(LANG_ITEM_DELETED_FROM_LIST, itemId, itemTemplate->GetDefaultLocaleName());
|
||||
handler->PSendSysMessage(LANG_ITEM_DELETED_FROM_LIST, itemId, item->GetDefaultLocaleName());
|
||||
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()), GetCaster()->ToCreature()->m_Events.CalculateTime(2500ms));
|
||||
GetCaster()->ToCreature()->m_Events.AddEvent(new StartLaunchEvent(*GetExplTargetDest(), ASSERT_NOTNULL(GetHitPlayer())->GetGUID()), 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()
|
||||
|
||||
@@ -144,7 +144,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