Attacks now re-orients players like interactions so.
This commit is contained in:
@@ -315,14 +315,7 @@ namespace Content.Server.GameObjects.EntitySystems.Click
|
||||
|
||||
var item = hands.GetActiveHand?.Owner;
|
||||
|
||||
if (ActionBlockerSystem.CanChangeDirection(player))
|
||||
{
|
||||
var diff = coordinates.ToMapPos(EntityManager) - playerTransform.MapPosition.Position;
|
||||
if (diff.LengthSquared > 0.01f)
|
||||
{
|
||||
playerTransform.LocalRotation = new Angle(diff);
|
||||
}
|
||||
}
|
||||
ClickFace(player, coordinates);
|
||||
|
||||
if (!ActionBlockerSystem.CanInteract(player))
|
||||
{
|
||||
@@ -399,6 +392,18 @@ namespace Content.Server.GameObjects.EntitySystems.Click
|
||||
}
|
||||
}
|
||||
|
||||
private void ClickFace(IEntity player, EntityCoordinates coordinates)
|
||||
{
|
||||
if (ActionBlockerSystem.CanChangeDirection(player))
|
||||
{
|
||||
var diff = coordinates.ToMapPos(EntityManager) - player.Transform.MapPosition.Position;
|
||||
if (diff.LengthSquared > 0.01f)
|
||||
{
|
||||
player.Transform.LocalRotation = new Angle(diff);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// We didn't click on any entity, try doing an AfterInteract on the click location
|
||||
/// </summary>
|
||||
@@ -850,6 +855,8 @@ namespace Content.Server.GameObjects.EntitySystems.Click
|
||||
return;
|
||||
}
|
||||
|
||||
ClickFace(player, coordinates);
|
||||
|
||||
if (!ActionBlockerSystem.CanAttack(player) ||
|
||||
(!wideAttack && !player.InRangeUnobstructed(coordinates, ignoreInsideBlocker: true)))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user