Rochet2
2015-08-19 23:17:00 +03:00
parent 2517ed6442
commit f51217b0c4
4 changed files with 47 additions and 13 deletions

View File

@@ -20,6 +20,8 @@ struct ElunaCreatureAI : ScriptedAI
{
// used to delay the spawn hook triggering on AI creation
bool justSpawned;
// used to delay movementinform hook (WP hook)
std::vector< std::pair<uint32, uint32> > movepoints;
#ifndef TRINITY
#define me m_creature
#endif
@@ -42,6 +44,16 @@ struct ElunaCreatureAI : ScriptedAI
JustRespawned();
}
if (!movepoints.empty())
{
for (auto& point : movepoints)
{
if (!sEluna->MovementInform(me, point.first, point.second))
ScriptedAI::MovementInform(point.first, point.second);
}
movepoints.clear();
}
if (!sEluna->UpdateAI(me, diff))
{
#ifdef TRINITY
@@ -100,8 +112,9 @@ struct ElunaCreatureAI : ScriptedAI
//Called at waypoint reached or PointMovement end
void MovementInform(uint32 type, uint32 id) override
{
if (!sEluna->MovementInform(me, type, id))
ScriptedAI::MovementInform(type, id);
// delayed since hook triggers before actually reaching the point
// and starting new movement would bug
movepoints.push_back(std::make_pair(type, id));
}
// Called before EnterCombat even before the creature is in combat.