diff options
author | maximius <none@none> | 2009-10-17 15:35:07 -0700 |
---|---|---|
committer | maximius <none@none> | 2009-10-17 15:35:07 -0700 |
commit | 26b5e033ffde3d161382fc9addbfa99738379641 (patch) | |
tree | a344f369ca32945f787a02dee35c3dbe342bed7e /src/game/WaypointMovementGenerator.h | |
parent | f21f47005dcb6b76e1abc9f35fbcd03eed191bff (diff) |
*Massive cleanup (\n\n -> \n, *\n -> \n, cleanup for(...) to for (...), and some other cleanups by hand)
*Fix a possible crash in Spell::DoAllEffectOnTarget
--HG--
branch : trunk
Diffstat (limited to 'src/game/WaypointMovementGenerator.h')
-rw-r--r-- | src/game/WaypointMovementGenerator.h | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/src/game/WaypointMovementGenerator.h b/src/game/WaypointMovementGenerator.h index 4e64229b524..1f0f0b9e2e0 100644 --- a/src/game/WaypointMovementGenerator.h +++ b/src/game/WaypointMovementGenerator.h @@ -17,58 +17,45 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - #ifndef TRINITY_WAYPOINTMOVEMENTGENERATOR_H #define TRINITY_WAYPOINTMOVEMENTGENERATOR_H - /** @page PathMovementGenerator is used to generate movements * of waypoints and flight paths. Each serves the purpose * of generate activities so that it generates updated * packets for the players. */ - #include "MovementGenerator.h" #include "DestinationHolder.h" #include "WaypointManager.h" #include "Path.h" #include "Traveller.h" - #include "Player.h" - #include <vector> #include <set> - #define FLIGHT_TRAVEL_UPDATE 100 #define STOP_TIME_FOR_PLAYER 3 * MINUTE * IN_MILISECONDS // 3 Minutes - template<class T, class P = Path> class TRINITY_DLL_SPEC PathMovementBase { public: PathMovementBase() : i_currentNode(0) {} virtual ~PathMovementBase() {}; - bool MovementInProgress(void) const { return i_currentNode < i_path.Size(); } - void LoadPath(T &); void ReloadPath(T &); uint32 GetCurrentNode() const { return i_currentNode; } - protected: uint32 i_currentNode; DestinationHolder< Traveller<T> > i_destinationHolder; P i_path; }; - template<class T> - class TRINITY_DLL_SPEC WaypointMovementGenerator : public MovementGeneratorMedium< T, WaypointMovementGenerator<T> >, public PathMovementBase<T> { public: WaypointMovementGenerator(uint32 _path_id = 0, bool _repeating = true) : i_nextMoveTime(0), path_id(_path_id), repeating(_repeating), StopedByPlayer(false), node(NULL) {} - void Initialize(T &); void Finalize(T &); void MovementInform(T &); @@ -78,7 +65,6 @@ class TRINITY_DLL_SPEC WaypointMovementGenerator bool Update(T &, const uint32 &); bool GetDestination(float &x, float &y, float &z) const; MovementGeneratorType GetMovementGeneratorType() { return WAYPOINT_MOTION_TYPE; } - private: WaypointData *node; uint32 path_id; @@ -86,7 +72,6 @@ class TRINITY_DLL_SPEC WaypointMovementGenerator WaypointPath *waypoints; bool repeating, StopedByPlayer; }; - /** FlightPathMovementGenerator generates movement of the player for the paths * and hence generates ground and activities for the player. */ @@ -103,17 +88,14 @@ public PathMovementBase<Player> void Reset(Player &) {} bool Update(Player &, const uint32 &); MovementGeneratorType GetMovementGeneratorType() { return FLIGHT_MOTION_TYPE; } - void LoadPath(Player &); void ReloadPath(Player &) { /* don't reload flight path */ } - Path& GetPath() { return i_path; } uint32 GetPathAtMapEnd() const; bool HasArrived() const { return (i_currentNode >= i_path.Size()); } void SetCurrentNodeAfterTeleport(); void SkipCurrentNode() { ++i_currentNode; } bool GetDestination(float& x, float& y, float& z) const { i_destinationHolder.GetDestination(x,y,z); return true; } - private: // storage for preloading the flightmaster grid at end // before reaching final waypoint |