aboutsummaryrefslogtreecommitdiff
path: root/src/game/WaypointMovementGenerator.cpp
diff options
context:
space:
mode:
authormegamage <none@none>2008-12-30 20:05:36 -0600
committermegamage <none@none>2008-12-30 20:05:36 -0600
commitaa3b89d7764c093ba87ee2cf99775e3aedc37637 (patch)
treef6a403e42332dab84f77d7a611dc375083452875 /src/game/WaypointMovementGenerator.cpp
parent05301f91b90fc029af6df5717a6b48f0e1759008 (diff)
parent12d4ce413e7b3b9d697b160bac6c918564b2fd1e (diff)
*Update to HG 714.
--HG-- branch : trunk
Diffstat (limited to 'src/game/WaypointMovementGenerator.cpp')
-rw-r--r--src/game/WaypointMovementGenerator.cpp25
1 files changed, 13 insertions, 12 deletions
diff --git a/src/game/WaypointMovementGenerator.cpp b/src/game/WaypointMovementGenerator.cpp
index adc4345fdfc..c4025d9de5e 100644
--- a/src/game/WaypointMovementGenerator.cpp
+++ b/src/game/WaypointMovementGenerator.cpp
@@ -107,7 +107,7 @@ WaypointMovementGenerator<Creature>::Initialize(Creature &u)
Traveller<Creature> traveller(u);
node = *(waypoints->at(i_currentNode));
InitTraveller(u,node);
- i_destinationHolder.SetDestination(traveller, node.x, node.y, node.z);
+ i_destinationHolder.SetDestination(traveller, node->x, node->y, node->z);
i_nextMoveTime.Reset(i_destinationHolder.GetTotalTravelTime());
}*/
}
@@ -152,8 +152,9 @@ WaypointMovementGenerator<Creature>::Update(Creature &unit, const uint32 &diff)
{
if(StopedByPlayer)
{
- InitTraveller(unit,node);
- i_destinationHolder.SetDestination(traveller, node.x, node.y, node.z);
+ assert(node);
+ InitTraveller(unit, *node);
+ i_destinationHolder.SetDestination(traveller, node->x, node->y, node->z);
i_nextMoveTime.Reset(i_destinationHolder.GetTotalTravelTime());
StopedByPlayer = false;
return true;
@@ -165,7 +166,7 @@ WaypointMovementGenerator<Creature>::Update(Creature &unit, const uint32 &diff)
i_currentNode = 0; //Start moving all over again
else
{
- unit.SetHomePosition(node.x, node.y, node.z, unit.GetOrientation());
+ unit.SetHomePosition(node->x, node->y, node->z, unit.GetOrientation());
unit.GetMotionMaster()->Initialize();
return false; //Clear the waypoint movement
}
@@ -173,24 +174,24 @@ WaypointMovementGenerator<Creature>::Update(Creature &unit, const uint32 &diff)
else
i_currentNode++;
- node = *(waypoints->at(i_currentNode));
- InitTraveller(unit,node);
- i_destinationHolder.SetDestination(traveller, node.x, node.y, node.z);
+ node = waypoints->at(i_currentNode);
+ InitTraveller(unit, *node);
+ i_destinationHolder.SetDestination(traveller, node->x, node->y, node->z);
i_nextMoveTime.Reset(i_destinationHolder.GetTotalTravelTime());
}
else
{
//Determine waittime
- if(node.delay)
- i_nextMoveTime.Reset(node.delay);
+ if(node->delay)
+ i_nextMoveTime.Reset(node->delay);
- if(node.event_id && rand()%100 < node.event_chance)
- sWorld.ScriptsStart(sWaypointScripts, node.event_id, &unit, NULL);
+ if(node->event_id && rand()%100 < node->event_chance)
+ sWorld.ScriptsStart(sWaypointScripts, node->event_id, &unit, NULL);
MovementInform(unit);
unit.UpdateWaypointID(i_currentNode);
unit.clearUnitState(UNIT_STAT_MOVING);
- unit.Relocate(node.x, node.y, node.z);
+ unit.Relocate(node->x, node->y, node->z);
}
}
else