Merge pull request #4685 from Subv/fix1
Core/SAI: Crashfix and some more fixes
This commit is contained in:
@@ -0,0 +1,2 @@
|
|||||||
|
UPDATE smart_scripts SET action_param2 = action_param3 WHERE action_type = 80;
|
||||||
|
UPDATE smart_scripts SET action_param3 = 0 WHERE action_type = 80;
|
||||||
@@ -51,7 +51,6 @@ SmartScript::SmartScript()
|
|||||||
mTemplate = SMARTAI_TEMPLATE_BASIC;
|
mTemplate = SMARTAI_TEMPLATE_BASIC;
|
||||||
meOrigGUID = 0;
|
meOrigGUID = 0;
|
||||||
goOrigGUID = 0;
|
goOrigGUID = 0;
|
||||||
mResumeActionList = true;
|
|
||||||
mLastInvoker = 0;
|
mLastInvoker = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -78,22 +77,6 @@ void SmartScript::OnReset()
|
|||||||
|
|
||||||
void SmartScript::ProcessEventsFor(SMART_EVENT e, Unit* unit, uint32 var0, uint32 var1, bool bvar, const SpellInfo* spell, GameObject* gob)
|
void SmartScript::ProcessEventsFor(SMART_EVENT e, Unit* unit, uint32 var0, uint32 var1, bool bvar, const SpellInfo* spell, GameObject* gob)
|
||||||
{
|
{
|
||||||
if (e == SMART_EVENT_AGGRO)
|
|
||||||
{
|
|
||||||
if (!mResumeActionList)
|
|
||||||
mTimedActionList.clear();//clear action list if it is not resumable
|
|
||||||
else
|
|
||||||
{
|
|
||||||
for (SmartAIEventList::iterator itr = mTimedActionList.begin(); itr != mTimedActionList.end(); ++itr)
|
|
||||||
{
|
|
||||||
if (itr->enableTimed)
|
|
||||||
{
|
|
||||||
InitTimer((*itr));//re-init the currently enabled timer, so it restarts the timer when resumed
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for (SmartAIEventList::iterator i = mEvents.begin(); i != mEvents.end(); ++i)
|
for (SmartAIEventList::iterator i = mEvents.begin(); i != mEvents.end(); ++i)
|
||||||
{
|
{
|
||||||
SMART_EVENT eventType = SMART_EVENT((*i).GetEventType());
|
SMART_EVENT eventType = SMART_EVENT((*i).GetEventType());
|
||||||
@@ -3017,7 +3000,6 @@ void SmartScript::SetScript9(SmartScriptHolder& e, uint32 entry)
|
|||||||
i->event.type = SMART_EVENT_UPDATE_IC;
|
i->event.type = SMART_EVENT_UPDATE_IC;
|
||||||
else if (e.action.timedActionList.timerType > 1)
|
else if (e.action.timedActionList.timerType > 1)
|
||||||
i->event.type = SMART_EVENT_UPDATE;
|
i->event.type = SMART_EVENT_UPDATE;
|
||||||
mResumeActionList = e.action.timedActionList.dontResume ? false : true;
|
|
||||||
InitTimer((*i));
|
InitTimer((*i));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -228,7 +228,6 @@ class SmartScript
|
|||||||
SmartAIEventList mEvents;
|
SmartAIEventList mEvents;
|
||||||
SmartAIEventList mInstallEvents;
|
SmartAIEventList mInstallEvents;
|
||||||
SmartAIEventList mTimedActionList;
|
SmartAIEventList mTimedActionList;
|
||||||
bool mResumeActionList;
|
|
||||||
Creature* me;
|
Creature* me;
|
||||||
uint64 meOrigGUID;
|
uint64 meOrigGUID;
|
||||||
GameObject* go;
|
GameObject* go;
|
||||||
|
|||||||
@@ -824,7 +824,6 @@ struct SmartAction
|
|||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
uint32 id;
|
uint32 id;
|
||||||
uint32 dontResume;
|
|
||||||
uint32 timerType;
|
uint32 timerType;
|
||||||
} timedActionList;
|
} timedActionList;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user