Core/SAI: Fixed possible crashes in many SAI actions

Closes #1144
This commit is contained in:
Shauren committed 2011-06-15 17:33:06 +02:00
1 parent 1df876c3ec
commit a6708fd595
2 files changed
+93 -52

No files matched your search

@@ -101,7 +101,7 @@ class SmartScript
Unit* DoSelectLowestHpFriendly(float range, uint32 MinHPDiff);
void DoFindFriendlyCC(std::list<Creature*>& _list, float range);
void DoFindFriendlyMissingBuff(std::list<Creature*>& _list, float range, uint32 spellid);
void DoFindFriendlyMissingBuff(std::list<Creature*>& list, float range, uint32 spellid);
void StoreTargetList(ObjectList* targets, uint32 id)
{
@@ -124,7 +124,8 @@ class SmartScript
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));
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;
}
@@ -137,8 +138,8 @@ class SmartScript
if (!go || go->GetAIName() != "SmartGameObjectAI")
smart = false;
if (!smart)
sLog->outErrorDb("SmartScript: Action target GameObject(entry: %u) is not using SmartGameObjectAI, action skipped to prevent crash.", g ? g->GetEntry() : (go ? go->GetEntry() : 0));
sLog->outErrorDb("SmartScript: Action target GameObject(entry: %u) is not using SmartGameObjectAI, action skipped to prevent crash.", g?g->GetEntry():(go?go->GetEntry():0));
return smart;
}