Core/SmartAI: use Target types where possible, instead of simple self target

- removed some obsolete comments
- added errorlog if a special action uses a non-smart scripted creature

--HG--
branch : trunk
This commit is contained in:
Rat committed 2010-11-02 13:13:54 +01:00
1 parent b3b048449b
commit 7ed5f93aed
3 files changed
+187 -131

No files matched your search

@@ -107,9 +107,12 @@ class SmartScript
}
bool IsSmart(Creature* c = NULL)
{
if (c && c->GetAIName() != "SmartAI") return false;
if (!me || me->GetAIName() != "SmartAI") return false;
return true;
bool smart = true;
if (c && c->GetAIName() != "SmartAI") smart = false;
if (!me || me->GetAIName() != "SmartAI") smart = false;
if (!smart)
sLog.outErrorDb("SmartScript: Action target creature(entry: %u) is not using SmartAI, action skipped to prevent crash.", c?c->GetEntry():(me?me->GetEntry():0));
return smart;
}
ObjectList* GetTargetList(uint32 id)
{