mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-23 10:26:28 +01:00
* Batch of fixes for issues found by static analysis.
This commit is contained in:
@@ -482,7 +482,7 @@ public:
|
||||
char* arg3 = strtok(NULL, " ");
|
||||
bool isAccountNameGiven = true;
|
||||
|
||||
if (arg1 && !arg3)
|
||||
if (!arg3)
|
||||
{
|
||||
if (!handler->getSelectedPlayer())
|
||||
return false;
|
||||
|
||||
@@ -796,7 +796,7 @@ public:
|
||||
if (show == "info")
|
||||
{
|
||||
// Check if the user did specify a visual waypoint
|
||||
if (target->GetEntry() != VISUAL_WAYPOINT)
|
||||
if (target && target->GetEntry() != VISUAL_WAYPOINT)
|
||||
{
|
||||
handler->PSendSysMessage(LANG_WAYPOINT_VP_SELECT);
|
||||
handler->SetSentErrorMessage(true);
|
||||
|
||||
@@ -773,7 +773,7 @@ public:
|
||||
void JustSummoned(Creature* summon)
|
||||
{
|
||||
Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 30, true);
|
||||
if (target && summon)
|
||||
if (target)
|
||||
summon->Attack(target, false);
|
||||
summons.Summon(summon);
|
||||
}
|
||||
|
||||
@@ -182,10 +182,8 @@ public:
|
||||
}
|
||||
|
||||
if (!found)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
DoNextDialogueStep();
|
||||
}
|
||||
|
||||
@@ -210,7 +208,7 @@ private:
|
||||
void DoNextDialogueStep()
|
||||
{
|
||||
// Last Dialogue Entry done?
|
||||
if (_currentEntry && !_currentEntry->TextEntry)
|
||||
if (!_currentEntry || !_currentEntry->TextEntry)
|
||||
{
|
||||
_actionTimer = 0;
|
||||
return;
|
||||
|
||||
@@ -754,7 +754,7 @@ public:
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim() && _phase != PHASE_NOT_STARTED && _phase != PHASE_TWO)
|
||||
if (!instance || (!UpdateVictim() && _phase != PHASE_NOT_STARTED && _phase != PHASE_TWO))
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
@@ -854,7 +854,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
if (_arcaneReinforcements && instance)
|
||||
if (_arcaneReinforcements)
|
||||
{
|
||||
for (uint8 rangeDisks = 0; rangeDisks < (GetDifficulty() == RAID_DIFFICULTY_10MAN_NORMAL ? 4 : 5); rangeDisks++)
|
||||
{
|
||||
|
||||
@@ -1751,7 +1751,7 @@ public:
|
||||
{
|
||||
me->HandleEmoteCommand(emote);
|
||||
Unit* owner = me->GetOwner();
|
||||
if (emote != TEXT_EMOTE_KISS || owner || owner->GetTypeId() != TYPEID_PLAYER ||
|
||||
if (emote != TEXT_EMOTE_KISS || !owner || owner->GetTypeId() != TYPEID_PLAYER ||
|
||||
owner->ToPlayer()->GetTeam() != player->GetTeam())
|
||||
{
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user