diff options
author | megamage <none@none> | 2008-12-30 19:39:43 -0600 |
---|---|---|
committer | megamage <none@none> | 2008-12-30 19:39:43 -0600 |
commit | 12d4ce413e7b3b9d697b160bac6c918564b2fd1e (patch) | |
tree | 0857324aa2bb8792be82df5b0b42d92877943d2c | |
parent | bf3f1877853041dcb86db0429d719adba77776a2 (diff) |
*Update waypoint movement code. Also fix Linux build.
--HG--
branch : trunk
-rw-r--r-- | src/game/Object.cpp | 2 | ||||
-rw-r--r-- | src/game/WaypointMovementGenerator.cpp | 24 | ||||
-rw-r--r-- | src/game/WaypointMovementGenerator.h | 2 |
3 files changed, 14 insertions, 14 deletions
diff --git a/src/game/Object.cpp b/src/game/Object.cpp index efd041f34c2..51eea6ecc83 100644 --- a/src/game/Object.cpp +++ b/src/game/Object.cpp @@ -1519,7 +1519,7 @@ Creature* WorldObject::SummonCreature(uint32 id, float x, float y, float z, floa { TemporarySummon* pCreature = new TemporarySummon(GetGUID()); - pCreature->SetInstanceId(GetInstanceId()); + //pCreature->SetInstanceId(GetInstanceId()); uint32 team = 0; if (GetTypeId()==TYPEID_PLAYER) team = ((Player*)this)->GetTeam(); diff --git a/src/game/WaypointMovementGenerator.cpp b/src/game/WaypointMovementGenerator.cpp index 50219bfb6f4..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()); }*/ } @@ -153,8 +153,8 @@ WaypointMovementGenerator<Creature>::Update(Creature &unit, const uint32 &diff) if(StopedByPlayer) { assert(node); - InitTraveller(unit,node); - i_destinationHolder.SetDestination(traveller, node.x, node.y, node.z); + InitTraveller(unit, *node); + i_destinationHolder.SetDestination(traveller, node->x, node->y, node->z); i_nextMoveTime.Reset(i_destinationHolder.GetTotalTravelTime()); StopedByPlayer = false; return true; @@ -166,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 } @@ -174,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 diff --git a/src/game/WaypointMovementGenerator.h b/src/game/WaypointMovementGenerator.h index 99d111063de..899c55a5925 100644 --- a/src/game/WaypointMovementGenerator.h +++ b/src/game/WaypointMovementGenerator.h @@ -80,7 +80,7 @@ class TRINITY_DLL_SPEC WaypointMovementGenerator MovementGeneratorType GetMovementGeneratorType() { return WAYPOINT_MOTION_TYPE; } private: - WaypointData node; + WaypointData *node; uint32 path_id; TimeTrackerSmall i_nextMoveTime; WaypointPath *waypoints; |