Core/Movement: Fixed transport teleports on the same map (and teleporting on transports too)
This commit is contained in:
@@ -2734,7 +2734,7 @@ namespace Game.Entities
|
||||
public ObjectGuid lootingGroupLowGUID; // used to find group which is looting
|
||||
long m_packedRotation;
|
||||
Quaternion m_worldRotation;
|
||||
Position m_stationaryPosition;
|
||||
public Position m_stationaryPosition { get; set; }
|
||||
|
||||
GameObjectAI m_AI;
|
||||
ushort _animKitId;
|
||||
|
||||
@@ -519,8 +519,10 @@ namespace Game.Entities
|
||||
public void UpdatePosition(float x, float y, float z, float o)
|
||||
{
|
||||
bool newActive = GetMap().IsGridLoaded(x, y);
|
||||
Cell oldCell = new Cell(GetPositionX(), GetPositionY());
|
||||
|
||||
Relocate(x, y, z, o);
|
||||
m_stationaryPosition.SetOrientation(o);
|
||||
UpdateModelPosition();
|
||||
|
||||
UpdatePassengerPositions(_passengers);
|
||||
@@ -533,7 +535,7 @@ namespace Game.Entities
|
||||
*/
|
||||
if (_staticPassengers.Empty() && newActive) // 1. and 2.
|
||||
LoadStaticPassengers();
|
||||
else if (!_staticPassengers.Empty() && !newActive && new Cell(x, y).DiffGrid(new Cell(GetPositionX(), GetPositionY()))) // 3.
|
||||
else if (!_staticPassengers.Empty() && !newActive && oldCell.DiffGrid(new Cell(GetPositionX(), GetPositionY()))) // 3.
|
||||
UnloadStaticPassengers();
|
||||
else
|
||||
UpdatePassengerPositions(_staticPassengers);
|
||||
@@ -632,6 +634,8 @@ namespace Game.Entities
|
||||
}
|
||||
else
|
||||
{
|
||||
UpdatePosition(x, y, z, o);
|
||||
|
||||
// Teleport players, they need to know it
|
||||
foreach (var obj in _passengers)
|
||||
{
|
||||
@@ -651,7 +655,6 @@ namespace Game.Entities
|
||||
}
|
||||
}
|
||||
|
||||
UpdatePosition(x, y, z, o);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3096,7 +3096,7 @@ namespace Game.Maps
|
||||
|
||||
public Creature GetCreature(ObjectGuid guid)
|
||||
{
|
||||
if (!guid.IsCreature())
|
||||
if (!guid.IsCreatureOrVehicle())
|
||||
return null;
|
||||
|
||||
return (Creature)_objectsStore.LookupByKey(guid);
|
||||
|
||||
@@ -545,8 +545,8 @@ namespace Game.Network.Packets
|
||||
_worldPacket.WriteFloat(Facing);
|
||||
_worldPacket.WriteUInt8(PreloadWorld);
|
||||
|
||||
_worldPacket.WriteBit(Vehicle.HasValue);
|
||||
_worldPacket.WriteBit(TransportGUID.HasValue);
|
||||
_worldPacket.WriteBit(Vehicle.HasValue);
|
||||
_worldPacket.FlushBits();
|
||||
|
||||
if (Vehicle.HasValue)
|
||||
|
||||
Reference in New Issue
Block a user