diff options
author | megamage <none@none> | 2009-02-04 17:22:43 -0600 |
---|---|---|
committer | megamage <none@none> | 2009-02-04 17:22:43 -0600 |
commit | d69198732e65002b53bab3a85779107490fe4dd2 (patch) | |
tree | e1f4b11f1964cc42ac05c79bdc43eedc1db16866 /src/game/WaypointMovementGenerator.cpp | |
parent | 5d4d9530556eb66940775f12c3cc5f3c115447ca (diff) | |
parent | c745eba4a1d122b4184b27a982674c86ff193c23 (diff) |
*Merge.
--HG--
branch : trunk
Diffstat (limited to 'src/game/WaypointMovementGenerator.cpp')
-rw-r--r-- | src/game/WaypointMovementGenerator.cpp | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/game/WaypointMovementGenerator.cpp b/src/game/WaypointMovementGenerator.cpp index 97ce5feff43..a5bfb741188 100644 --- a/src/game/WaypointMovementGenerator.cpp +++ b/src/game/WaypointMovementGenerator.cpp @@ -53,14 +53,14 @@ template<> bool WaypointMovementGenerator<Creature>::GetDestination(float &x, float &y, float &z) const { if(i_destinationHolder.HasArrived()) - return false; - - i_destinationHolder.GetDestination(x, y, z); + return false; + + i_destinationHolder.GetDestination(x, y, z); return true; } template<> -bool WaypointMovementGenerator<Player>::GetDestination(float &x, float &y, float &z) const +bool WaypointMovementGenerator<Player>::GetDestination(float &x, float &y, float &z) const { return false; } @@ -80,13 +80,13 @@ void WaypointMovementGenerator<Creature>::InitTraveller(Creature &unit, const Wa { node.run ? unit.RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE): unit.AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - + unit.SetUInt32Value(UNIT_NPC_EMOTESTATE, 0); unit.SetUInt32Value(UNIT_FIELD_BYTES_1, 0); - + if(unit.canFly()) unit.AddUnitMovementFlag(MOVEMENTFLAG_FLYING2); - + unit.addUnitState(UNIT_STAT_ROAMING); } @@ -133,7 +133,7 @@ WaypointMovementGenerator<Creature>::Update(Creature &unit, const uint32 &diff) if(!path_id) return false; - + // Waypoint movement can be switched on/off // This is quite handy for escort quests and other stuff if(unit.hasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED | UNIT_STAT_DISTRACTED)) @@ -161,7 +161,7 @@ WaypointMovementGenerator<Creature>::Update(Creature &unit, const uint32 &diff) StopedByPlayer = false; return true; } - + if(i_currentNode == waypoints->size() - 1) //If that's our last waypoint { if(repeating) //If the movement is repeating @@ -173,7 +173,7 @@ WaypointMovementGenerator<Creature>::Update(Creature &unit, const uint32 &diff) return false; //Clear the waypoint movement } } - else + else i_currentNode++; node = waypoints->at(i_currentNode); @@ -183,20 +183,20 @@ WaypointMovementGenerator<Creature>::Update(Creature &unit, const uint32 &diff) } else { - //Determine waittime + //Determine waittime 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); - + MovementInform(unit); unit.UpdateWaypointID(i_currentNode); unit.clearUnitState(UNIT_STAT_MOVING); unit.Relocate(node->x, node->y, node->z); } } - else + else { if(unit.IsStopped() && !i_destinationHolder.HasArrived()) { |