aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp9
-rw-r--r--src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp9
-rw-r--r--src/server/game/Entities/GameObject/GameObject.cpp2
-rw-r--r--src/server/game/Entities/Player/Player.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/instance_blackrock_spire.cpp1
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_salramm_the_fleshcrafter.cpp2
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp2
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/npc_arthas.cpp31
-rw-r--r--src/server/scripts/Northrend/FrozenHalls/PitOfSaron/instance_pit_of_saron.cpp4
-rw-r--r--src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp1
10 files changed, 24 insertions, 39 deletions
diff --git a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp
index 354d21d5d9f..46085bf79ab 100644
--- a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp
+++ b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp
@@ -276,13 +276,10 @@ void EscortAI::AddWaypoint(uint32 id, float x, float y, float z, float orientati
void EscortAI::Start(bool isActiveAttacker /* = true*/, bool run /* = false */, ObjectGuid playerGUID /* = 0 */, Quest const* quest /* = nullptr */, bool instantRespawn /* = false */, bool canLoopPath /* = false */, bool resetWaypoints /* = true */)
{
// Queue respawn from the point it starts
- if (Map* map = me->GetMap())
+ if (CreatureData const* cdata = me->GetCreatureData())
{
- if (CreatureData const* cdata = me->GetCreatureData())
- {
- if (sWorld->getBoolConfig(CONFIG_RESPAWN_DYNAMIC_ESCORTNPC) && (cdata->spawnGroupData->flags & SPAWNGROUP_FLAG_ESCORTQUESTNPC))
- me->SaveRespawnTime(me->GetRespawnDelay());
- }
+ if (sWorld->getBoolConfig(CONFIG_RESPAWN_DYNAMIC_ESCORTNPC) && (cdata->spawnGroupData->flags & SPAWNGROUP_FLAG_ESCORTQUESTNPC))
+ me->SaveRespawnTime(me->GetRespawnDelay());
}
if (me->IsEngaged())
diff --git a/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp
index 5846a57f8aa..ab8664c6e01 100644
--- a/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp
+++ b/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp
@@ -156,13 +156,10 @@ void FollowerAI::UpdateFollowerAI(uint32 /*uiDiff*/)
void FollowerAI::StartFollow(Player* player, uint32 factionForFollower, uint32 quest)
{
- if (Map* map = me->GetMap())
+ if (CreatureData const* cdata = me->GetCreatureData())
{
- if (CreatureData const* cdata = me->GetCreatureData())
- {
- if (sWorld->getBoolConfig(CONFIG_RESPAWN_DYNAMIC_ESCORTNPC) && (cdata->spawnGroupData->flags & SPAWNGROUP_FLAG_ESCORTQUESTNPC))
- me->SaveRespawnTime(me->GetRespawnDelay());
- }
+ if (sWorld->getBoolConfig(CONFIG_RESPAWN_DYNAMIC_ESCORTNPC) && (cdata->spawnGroupData->flags & SPAWNGROUP_FLAG_ESCORTQUESTNPC))
+ me->SaveRespawnTime(me->GetRespawnDelay());
}
if (me->IsEngaged())
diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp
index 0ee4af88702..b03bba6b4cb 100644
--- a/src/server/game/Entities/GameObject/GameObject.cpp
+++ b/src/server/game/Entities/GameObject/GameObject.cpp
@@ -769,7 +769,7 @@ void GameObject::Update(uint32 diff)
Unit* target = nullptr;
/// @todo this hack with search required until GO casting not implemented
- if (Unit* owner = GetOwner())
+ if (GetOwner())
{
// Hunter trap: Search units which are unfriendly to the trap's owner
Trinity::NearestAttackableNoTotemUnitInObjectRangeCheck checker(this, radius);
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index 05a04187978..321868ba618 100644
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -25376,7 +25376,7 @@ void Player::UpdateVisibleGameobjectsOrSpellClicks()
auto clickBounds = sObjectMgr->GetSpellClickInfoMapBounds(obj->GetEntry());
for (auto const& clickPair : clickBounds)
{
- if (ConditionContainer const* conds = sConditionMgr->GetConditionsForSpellClickEvent(obj->GetEntry(), clickPair.second.spellId))
+ if (sConditionMgr->GetConditionsForSpellClickEvent(obj->GetEntry(), clickPair.second.spellId))
{
UF::ObjectData::Base objMask;
UF::UnitData::Base unitMask;
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/instance_blackrock_spire.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/instance_blackrock_spire.cpp
index 95ac00118f9..ede6a51d060 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/instance_blackrock_spire.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/instance_blackrock_spire.cpp
@@ -298,6 +298,7 @@ public:
if (GetBossState(DATA_DRAGONSPIRE_ROOM) != DONE)
Events.ScheduleEvent(EVENT_DARGONSPIRE_ROOM_STORE, 1s);
}
+ break;
case DATA_BLACKHAND_INCARCERATOR:
for (GuidList::const_iterator itr = _incarceratorList.begin(); itr != _incarceratorList.end(); ++itr)
if (Creature* creature = instance->GetCreature(*itr))
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_salramm_the_fleshcrafter.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_salramm_the_fleshcrafter.cpp
index bf17d74e7ad..075e7315285 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_salramm_the_fleshcrafter.cpp
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_salramm_the_fleshcrafter.cpp
@@ -110,7 +110,7 @@ class boss_salramm : public CreatureScript
break;
case EVENT_EXPLODE_GHOUL2:
events.ScheduleEvent(EVENT_SUMMON_GHOULS, Seconds(4));
- // intentional missing break
+ /* fallthrough */
case EVENT_EXPLODE_GHOUL1:
Talk(SAY_EXPLODE_GHOUL);
DoCastAOE(SPELL_EXPLODE_GHOUL, true);
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp
index ecae7ab189d..eac319c4191 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp
@@ -361,7 +361,7 @@ class npc_chromie_start : public CreatureScript
break;
case GOSSIP_OFFSET_SKIP_1:
AdvanceDungeonFar();
- // intentional missing break
+ /* fallthrough */
case GOSSIP_OFFSET_TELEPORT:
CloseGossipMenuFor(player);
me->CastSpell(player, SPELL_TELEPORT_PLAYER);
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/npc_arthas.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/npc_arthas.cpp
index 9a74bcb0fc7..ffefb1457a9 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/npc_arthas.cpp
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/npc_arthas.cpp
@@ -1095,28 +1095,17 @@ public:
me->GetCreatureListWithEntryInGrid(nearbyVictims, urand(0, 1) ? NPC_CITIZEN : NPC_RESIDENT, 60.0f);
if (!nearbyVictims.empty())
{
- std::list<Creature*>::iterator it = nearbyVictims.begin();
- std::advance(it, urand(0, nearbyVictims.size()-1));
- Emote emote;
- switch (urand(0, 3))
+ Emote emotes[] =
{
- case 0:
- emote = EMOTE_ONESHOT_TALK;
- break;
- case 1:
- emote = EMOTE_ONESHOT_EXCLAMATION;
- break;
- case 2:
- emote = EMOTE_ONESHOT_RUDE;
- break;
- case 3:
- emote = EMOTE_ONESHOT_ROAR;
- break;
- default:
- break;
- }
- if ((*it)->IsAlive())
- (*it)->HandleEmoteCommand(emote);
+ EMOTE_ONESHOT_TALK,
+ EMOTE_ONESHOT_EXCLAMATION,
+ EMOTE_ONESHOT_RUDE,
+ EMOTE_ONESHOT_ROAR
+ };
+
+ Creature* victim = Trinity::Containers::SelectRandomContainerElement(nearbyVictims);
+ if (victim->IsAlive())
+ victim->HandleEmoteCommand(Trinity::Containers::SelectRandomContainerElement(emotes));
}
break;
}
diff --git a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/instance_pit_of_saron.cpp b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/instance_pit_of_saron.cpp
index 12dcb97e494..f2b25d4b3bf 100644
--- a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/instance_pit_of_saron.cpp
+++ b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/instance_pit_of_saron.cpp
@@ -157,7 +157,7 @@ class instance_pit_of_saron : public InstanceMapScript
case DATA_GARFROST:
if (state == DONE)
{
- if (Creature* summoner = instance->GetCreature(_garfrostGUID))
+ if (instance->GetCreature(_garfrostGUID))
{
if (_teamInInstance == ALLIANCE)
{
@@ -175,7 +175,7 @@ class instance_pit_of_saron : public InstanceMapScript
case DATA_TYRANNUS:
if (state == DONE)
{
- if (Creature* summoner = instance->GetCreature(_tyrannusGUID))
+ if (instance->GetCreature(_tyrannusGUID))
{
if (_teamInInstance == ALLIANCE)
{
diff --git a/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp b/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp
index 6fad136251b..8aa2e149d2c 100644
--- a/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp
+++ b/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp
@@ -402,6 +402,7 @@ struct boss_thaddius : public BossAI
break;
case EVENT_ENABLE_BALL_LIGHTNING:
ballLightningUnlocked = true;
+ break;
case EVENT_ENGAGE:
me->SetReactState(REACT_AGGRESSIVE);
break;