Construction Bugfixes (#1329)

* Added: CanReach property to AfterAttack events which signals if the attack was within reach.
Fixed: You cannot construct/deconstruct things out of reach.
Fixed: Construction entities now preserve transform rotation.
Fixed: No more exceptions about missing grids when constructing world entities.
Fixed: Used the proper intermediate sprite for intermediate entities.
Fixed: Issue with missing sprite layers on ghost.

* The alligator is greedy, he always eats the bigger number...

* Adds a check so that you cannot use tools on entities that are obstructed from view.
This commit is contained in:
Acruid
2020-07-10 16:52:07 -07:00
committed by GitHub
parent 89c111664a
commit b6b31b7294
4 changed files with 47 additions and 19 deletions

View File

@@ -1,4 +1,4 @@
using System;
using System;
using JetBrains.Annotations;
using Robust.Shared.GameObjects;
using Robust.Shared.Interfaces.GameObjects;
@@ -23,6 +23,7 @@ namespace Content.Server.Interfaces.GameObjects.Components.Interaction
public IEntity User { get; set; }
public GridCoordinates ClickLocation { get; set; }
public IEntity Target { get; set; }
public bool CanReach { get; set; }
}
/// <summary>
@@ -56,12 +57,19 @@ namespace Content.Server.Interfaces.GameObjects.Components.Interaction
/// </summary>
public GridCoordinates ClickLocation { get; }
public AfterInteractMessage(IEntity user, IEntity itemInHand, IEntity attacked, GridCoordinates clickLocation)
/// <summary>
/// Is the click location close enough to reach by the player? This does not check for obstructions, just that the target is within
/// reach radius around the user.
/// </summary>
public bool CanReach { get; }
public AfterInteractMessage(IEntity user, IEntity itemInHand, IEntity attacked, GridCoordinates clickLocation, bool canReach)
{
User = user;
Attacked = attacked;
ClickLocation = clickLocation;
ItemInHand = itemInHand;
CanReach = canReach;
}
}