aboutsummaryrefslogtreecommitdiff
path: root/src/game/Creature.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/Creature.cpp')
-rw-r--r--src/game/Creature.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/game/Creature.cpp b/src/game/Creature.cpp
index e2124feff53..ee39245fc3b 100644
--- a/src/game/Creature.cpp
+++ b/src/game/Creature.cpp
@@ -594,10 +594,6 @@ bool Creature::AIM_Initialize(CreatureAI* ai)
return false;
}
- // don't allow AI switch when possessed
- if (isPossessed())
- return false;
-
CreatureAI * oldAI = i_AI;
i_motionMaster.Initialize();
i_AI = ai ? ai : FactorySelector::selectAI(this);
@@ -621,6 +617,8 @@ void Creature::DisablePossessedAI()
{
if (!i_AI_possessed) return;
+ delete i_AI_possessed;
+
// Signal the old AI that it's been re-enabled
i_AI->OnPossess(false);
}
@@ -1158,6 +1156,7 @@ void Creature::SetLootRecipient(Unit *unit)
if (!unit)
{
m_lootRecipient = 0;
+ RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_OTHER_TAGGER);
return;
}