Core/Movement: crashfix workaround
Port From (https://github.com/TrinityCore/TrinityCore/commit/ab740026b30b80e8599a0ad8c8a8eb466b6f4222)
This commit is contained in:
@@ -204,8 +204,12 @@ namespace Game.Entities
|
|||||||
|
|
||||||
MoveSplineInit init = new(this);
|
MoveSplineInit init = new(this);
|
||||||
init.MoveTo(GetPositionX(), GetPositionY(), GetPositionZ(), false);
|
init.MoveTo(GetPositionX(), GetPositionY(), GetPositionZ(), false);
|
||||||
|
if (GetTransport())
|
||||||
|
init.DisableTransportPathTransformations(); // It makes no sense to target global orientation
|
||||||
init.SetFacing(ori);
|
init.SetFacing(ori);
|
||||||
GetMotionMaster().LaunchMoveSpline(init, EventId.Face, MovementSlot.Controlled);
|
|
||||||
|
//GetMotionMaster().LaunchMoveSpline(init, EventId.Face, MovementSlot.Controlled);
|
||||||
|
init.Launch();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetFacingToObject(WorldObject obj, bool force = true)
|
public void SetFacingToObject(WorldObject obj, bool force = true)
|
||||||
@@ -215,7 +219,12 @@ namespace Game.Entities
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
// @todo figure out under what conditions creature will move towards object instead of facing it where it currently is.
|
// @todo figure out under what conditions creature will move towards object instead of facing it where it currently is.
|
||||||
SetFacingTo(GetAbsoluteAngle(obj));
|
MoveSplineInit init = new(this);
|
||||||
|
init.MoveTo(GetPositionX(), GetPositionY(), GetPositionZ(), false);
|
||||||
|
init.SetFacing(GetAbsoluteAngle(obj)); // when on transport, GetAbsoluteAngle will still return global coordinates (and angle) that needs transforming
|
||||||
|
|
||||||
|
//GetMotionMaster().LaunchMoveSpline(init, EventId.Face, MovementSlot.Controlled);
|
||||||
|
init.Launch();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void MonsterMoveWithSpeed(float x, float y, float z, float speed, bool generatePath = false, bool forceDestination = false)
|
public void MonsterMoveWithSpeed(float x, float y, float z, float speed, bool generatePath = false, bool forceDestination = false)
|
||||||
|
|||||||
Reference in New Issue
Block a user