mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-21 17:54:48 +01:00
*Movement Generators standardization.
- bool GetDestination(&x,&y,&z) added to all movement generators.(it is used by update of players view distance) - Fixed when creature entering in combat not count this as StoppedByPlayer. - Random Movement Generator - added support for creating custom spawndist during the game. - Random Movement Generator - Db spawndist is checked only at initialize(NOT in each sellect of random location). - Added Random Movement to motion master - it can be called now by MoveRandom(spawndist) e.g. for use in SD2. - Home and Random movements no more using RespawnCoords(Home Position has implemented) - Fixed bug when creature is moving on path and enter combat, after that returns to spawn position. -Typo fix in Confused Movement Generator --HG-- branch : trunk
This commit is contained in:
@@ -24,7 +24,6 @@
|
||||
#include "MapManager.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "DestinationHolderImp.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "WorldPacket.h"
|
||||
|
||||
void
|
||||
@@ -49,7 +48,7 @@ HomeMovementGenerator<Creature>::_setTargetLocation(Creature & owner)
|
||||
return;
|
||||
|
||||
float x, y, z;
|
||||
owner.GetRespawnCoord(x, y, z);
|
||||
owner.GetHomePosition(x, y, z, ori);
|
||||
|
||||
CreatureTraveller traveller(owner);
|
||||
|
||||
@@ -71,13 +70,10 @@ HomeMovementGenerator<Creature>::Update(Creature &owner, const uint32& time_diff
|
||||
// restore orientation of not moving creature at returning to home
|
||||
if(owner.GetDefaultMovementType()==IDLE_MOTION_TYPE)
|
||||
{
|
||||
if(CreatureData const* data = objmgr.GetCreatureData(owner.GetDBTableGUIDLow()))
|
||||
{
|
||||
owner.SetOrientation(data->orientation);
|
||||
WorldPacket packet;
|
||||
owner.BuildHeartBeatMsg(&packet);
|
||||
owner.SendMessageToSet(&packet, false);
|
||||
}
|
||||
owner.SetOrientation(ori);
|
||||
WorldPacket packet;
|
||||
owner.BuildHeartBeatMsg(&packet);
|
||||
owner.SendMessageToSet(&packet, false);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user