aboutsummaryrefslogtreecommitdiff
path: root/src/game/Creature.cpp
diff options
context:
space:
mode:
authormegamage <none@none>2009-01-09 16:43:23 -0600
committermegamage <none@none>2009-01-09 16:43:23 -0600
commit1ffb1cef3344206dfea149cb78146c30449d51c2 (patch)
tree655ac591f6f5aaca3dc65d67f3940f589e2394db /src/game/Creature.cpp
parent5c8f52d134899e10484dd47e91b612e2228842bf (diff)
parent90a82a81ad5d20d5e7188d6e9d660280f0b1eab4 (diff)
*Merge.
--HG-- branch : trunk
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;
}