Core/SmartAI: ACTION_CALL_CASTEDCREATUREORGO can now be used with GameObjects too

--HG--
branch : trunk
This commit is contained in:
Rat
2010-12-09 22:21:11 +01:00
parent 855b8bcd20
commit b5e24cbb9c

View File

@@ -460,13 +460,13 @@ void SmartScript::ProcessAction(SmartScriptHolder &e, Unit* unit, uint32 var0, u
}
case SMART_ACTION_CALL_CASTEDCREATUREORGO:
{
if (!me) return;
if (!GetBaseObject()) return;
ObjectList* targets = GetTargets(e, unit);
if (!targets) return;
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); itr++)
{
if (IsPlayer((*itr)))
(*itr)->ToPlayer()->CastedCreatureOrGO(e.action.castedCreatureOrGO.creature, me->GetGUID(), e.action.castedCreatureOrGO.spell);
(*itr)->ToPlayer()->CastedCreatureOrGO(e.action.castedCreatureOrGO.creature, GetBaseObject()->GetGUID(), e.action.castedCreatureOrGO.spell);
}
break;
}