aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormegamage <none@none>2008-12-24 10:33:58 -0600
committermegamage <none@none>2008-12-24 10:33:58 -0600
commitf511dc2c12f37538d057beb2d945a20c76f1a464 (patch)
treec68b2cf57742762a8be72e531defd92aac91b9d5 /src
parent3cb4e7c716b11f357b3265257c51e7b6cc5c36f9 (diff)
parent12a52d2fbb3aef60f7eff73d1a10e0dbe9de5edf (diff)
*Mangos 6940 + Trinity 615.
--HG-- branch : trunk
Diffstat (limited to 'src')
-rw-r--r--src/game/Creature.cpp3
-rw-r--r--src/game/WaypointManager.cpp3
-rw-r--r--src/game/WaypointMovementGenerator.cpp17
-rw-r--r--src/shared/revision_nr.h2
4 files changed, 11 insertions, 14 deletions
diff --git a/src/game/Creature.cpp b/src/game/Creature.cpp
index 5a3e9512bd0..e4d4eec9ef5 100644
--- a/src/game/Creature.cpp
+++ b/src/game/Creature.cpp
@@ -220,7 +220,8 @@ void Creature::RemoveCorpse()
float x,y,z,o;
GetRespawnCoord(x, y, z, &o);
- GetMap()->CreatureRelocation(this,x,y,z,o);
+ SetHomePosition(x,y,z,o);
+ GetMap()->CreatureRelocation(this,x,y,z,o);
}
/**
diff --git a/src/game/WaypointManager.cpp b/src/game/WaypointManager.cpp
index c18c09bcc17..fc0ca9e8007 100644
--- a/src/game/WaypointManager.cpp
+++ b/src/game/WaypointManager.cpp
@@ -34,7 +34,7 @@ void WaypointStore::Free()
void WaypointStore::Load()
{
- QueryResult *result = WorldDatabase.PQuery("SELECT MAX(`id`) FROM `waypoint_data");
+ QueryResult *result = WorldDatabase.PQuery("SELECT MAX(`id`) FROM `waypoint_data`");
if(!result)
{
sLog.outError(" an error occured while loading the table `waypoint_data` ( maybe it doesn't exist ?)\n");
@@ -44,7 +44,6 @@ void WaypointStore::Load()
records = (*result)[0].GetUInt32();
delete result;
-
result = WorldDatabase.PQuery("SELECT `id`,`point`,`position_x`,`position_y`,`position_z`,`move_flag`,`delay`,`action`,`action_chance` FROM `waypoint_data` ORDER BY `id`, `point`");
if(!result)
{
diff --git a/src/game/WaypointMovementGenerator.cpp b/src/game/WaypointMovementGenerator.cpp
index 71d05d073d2..85ef44b51be 100644
--- a/src/game/WaypointMovementGenerator.cpp
+++ b/src/game/WaypointMovementGenerator.cpp
@@ -15,24 +15,17 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-
-//Basic header
-#include <ctime>
-
+//Basic headers
#include "WaypointMovementGenerator.h"
#include "DestinationHolderImp.h"
-//Accessors
-#include "Database/DatabaseEnv.h"
+//Extended headers
#include "ObjectMgr.h"
#include "World.h"
//Creature-specific headers
#include "Creature.h"
#include "CreatureAI.h"
-//Player-Specific
+//Player-specific
#include "Player.h"
-//Visual
-#include "ProgressBar.h"
-#include "MapManager.h"
template<class T>
void
@@ -42,6 +35,8 @@ template<>
void
WaypointMovementGenerator<Creature>::Initialize(Creature &u)
{
+ u.StopMoving();
+ i_nextMoveTime.Reset(0);
i_currentNode = -1;
if(!path_id)
path_id = u.GetWaypointPath();
@@ -160,6 +155,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.GetMotionMaster()->Initialize();
return false; //Clear the waypoint movement
}
@@ -184,6 +180,7 @@ WaypointMovementGenerator<Creature>::Update(Creature &unit, const uint32 &diff)
MovementInform(unit);
unit.UpdateWaypointID(i_currentNode);
unit.clearUnitState(UNIT_STAT_MOVING);
+ unit.Relocate(node.x, node.y, node.z);
}
}
else
diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h
index 946507dcf2f..5d6f980e5f4 100644
--- a/src/shared/revision_nr.h
+++ b/src/shared/revision_nr.h
@@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
- #define REVISION_NR "6938"
+ #define REVISION_NR "6940"
#endif // __REVISION_NR_H__