aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortreeston <treeston.mmoc@gmail.com>2016-10-15 13:19:03 +0200
committertreeston <treeston.mmoc@gmail.com>2016-10-15 13:19:17 +0200
commitaab7abfd045b935e112feec4b192fb7921394766 (patch)
tree444aa806cc5828426db1404da0c5611a4aed6d5d
parent4de5a6e00594262e248640c125f0a7dfc88351ba (diff)
Core/Creature: Fix respawn logic to call reset react state BEFORE calling Reset(). Fixes Krik'thir behavior after a wipe (and maybe some others).
Fixes and closes #18011.
-rw-r--r--src/server/game/Entities/Creature/Creature.cpp5
-rw-r--r--src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_krikthir_the_gatewatcher.cpp19
2 files changed, 12 insertions, 12 deletions
diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp
index a7b826b4bf8..b312f5694be 100644
--- a/src/server/game/Entities/Creature/Creature.cpp
+++ b/src/server/game/Entities/Creature/Creature.cpp
@@ -1765,6 +1765,8 @@ void Creature::Respawn(bool force)
}
GetMotionMaster()->InitDefault();
+ //Re-initialize reactstate that could be altered by movementgenerators
+ InitializeReactState();
//Call AI respawn virtual function
if (IsAIEnabled)
@@ -1777,9 +1779,6 @@ void Creature::Respawn(bool force)
uint32 poolid = GetSpawnId() ? sPoolMgr->IsPartOfAPool<Creature>(GetSpawnId()) : 0;
if (poolid)
sPoolMgr->UpdatePool<Creature>(poolid, GetSpawnId());
-
- //Re-initialize reactstate that could be altered by movementgenerators
- InitializeReactState();
}
UpdateObjectVisibility();
diff --git a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_krikthir_the_gatewatcher.cpp b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_krikthir_the_gatewatcher.cpp
index ea912da4c3d..0d52a09bbdc 100644
--- a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_krikthir_the_gatewatcher.cpp
+++ b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_krikthir_the_gatewatcher.cpp
@@ -138,10 +138,10 @@ class boss_krik_thir : public CreatureScript
for (uint8 i = 1; i <= 3; ++i)
{
- std::list<TempSummon*> summons;
- me->SummonCreatureGroup(i, &summons);
- for (TempSummon* summon : summons)
- summon->AI()->SetData(DATA_PET_GROUP, i);
+ std::list<TempSummon*> adds;
+ me->SummonCreatureGroup(i, &adds);
+ for (TempSummon* add : adds)
+ add->AI()->SetData(DATA_PET_GROUP, i);
}
}
@@ -416,10 +416,7 @@ class npc_watcher_gashra : public CreatureScript
struct npc_watcher_gashraAI : public npc_gatewatcher_petAI
{
- npc_watcher_gashraAI(Creature* creature) : npc_gatewatcher_petAI(creature, true)
- {
- me->SetReactState(REACT_PASSIVE);
- }
+ npc_watcher_gashraAI(Creature* creature) : npc_gatewatcher_petAI(creature, true) { }
void Reset() override
{
@@ -928,11 +925,15 @@ class spell_gatewatcher_subboss_trigger : public SpellScriptLoader
void HandleTargets(std::list<WorldObject*>& targetList)
{
// Remove any Watchers that are already in combat
- for (std::list<WorldObject*>::iterator it = targetList.begin(); it != targetList.end(); ++it)
+ auto it = targetList.begin();
+ while (it != targetList.end())
{
if (Creature* creature = (*it)->ToCreature())
if (creature->IsAlive() && !creature->IsInCombat())
+ {
+ ++it;
continue;
+ }
it = targetList.erase(it);
}