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;
|
var item = hands.GetActiveHand?.Owner;
|
||||||
|
|
||||||
if (ActionBlockerSystem.CanChangeDirection(player))
|
ClickFace(player, coordinates);
|
||||||
{
|
|
||||||
var diff = coordinates.ToMapPos(EntityManager) - playerTransform.MapPosition.Position;
|
|
||||||
if (diff.LengthSquared > 0.01f)
|
|
||||||
{
|
|
||||||
playerTransform.LocalRotation = new Angle(diff);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!ActionBlockerSystem.CanInteract(player))
|
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>
|
/// <summary>
|
||||||
/// We didn't click on any entity, try doing an AfterInteract on the click location
|
/// We didn't click on any entity, try doing an AfterInteract on the click location
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -850,6 +855,8 @@ namespace Content.Server.GameObjects.EntitySystems.Click
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ClickFace(player, coordinates);
|
||||||
|
|
||||||
if (!ActionBlockerSystem.CanAttack(player) ||
|
if (!ActionBlockerSystem.CanAttack(player) ||
|
||||||
(!wideAttack && !player.InRangeUnobstructed(coordinates, ignoreInsideBlocker: true)))
|
(!wideAttack && !player.InRangeUnobstructed(coordinates, ignoreInsideBlocker: true)))
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user