diff options
| author | Subv <s.v.h21@hotmail.com> | 2012-02-11 10:49:28 -0500 |
|---|---|---|
| committer | Subv <s.v.h21@hotmail.com> | 2012-02-11 10:49:28 -0500 |
| commit | c5e2e189de78c419ba1063ba025e5efe69aabd06 (patch) | |
| tree | ae72f32a8ee24942a470920a1daaa4070620d14d /src/server/game/AI | |
| parent | 784d58c02370ca69764c54a1fdf438ca59e4917a (diff) | |
Core/Conditions: Allow to set SAI conditions to both the invoker and the object using ConditionTarget column.
ConditionTarget 0 = invoker
ConditionTarget 1 = object
Signed-off-by: Subv <s.v.h21@hotmail.com>
Diffstat (limited to 'src/server/game/AI')
| -rw-r--r-- | src/server/game/AI/SmartScripts/SmartScript.cpp | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index 4b15805c2c9..0794179d158 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -85,14 +85,9 @@ void SmartScript::ProcessEventsFor(SMART_EVENT e, Unit* unit, uint32 var0, uint3 if (eventType == e/* && (!(*i).event.event_phase_mask || IsInPhase((*i).event.event_phase_mask)) && !((*i).event.event_flags & SMART_EVENT_FLAG_NOT_REPEATABLE && (*i).runOnce)*/) { bool meets = true; - if (unit) - { - if (Player* player = unit->ToPlayer()) - { - ConditionList conds = sConditionMgr->GetConditionsForSmartEvent((*i).entryOrGuid, (*i).event_id, (*i).source_type); - meets = sConditionMgr->IsObjectMeetToConditions(player, conds); - } - } + ConditionList conds = sConditionMgr->GetConditionsForSmartEvent((*i).entryOrGuid, (*i).event_id, (*i).source_type); + ConditionSourceInfo info = ConditionSourceInfo(unit, GetBaseObject()); + meets = sConditionMgr->IsObjectMeetToConditionList(info, conds); if (meets) ProcessEvent(*i, unit, var0, var1, bvar, spell, gob); |
