This commit is contained in:
Clyybber
2020-05-23 17:23:25 +02:00
committed by GitHub
parent 05b910d9db
commit 1ad9a10050
40 changed files with 200 additions and 199 deletions

View File

@@ -17,7 +17,7 @@ namespace Content.Server.BodySystem {
/// Component representing the many BodyParts attached to each other.
/// </summary>
[RegisterComponent]
public class BodyManagerComponent : Component, IAttackHand {
public class BodyManagerComponent : Component, IInteractHand {
public sealed override string Name => "BodyManager";
#pragma warning disable CS0649
@@ -117,7 +117,7 @@ namespace Content.Server.BodySystem {
///////// Server-specific stuff
/////////
public bool AttackHand(AttackHandEventArgs eventArgs)
public bool InteractHand(InteractHandEventArgs eventArgs)
{
//TODO: remove organs?
return false;

View File

@@ -28,7 +28,7 @@ namespace Content.Server.GameObjects.Components.Weapon.Melee
{
[RegisterComponent]
public class ServerSurgeryToolComponent : SharedSurgeryToolComponent, IAfterAttack
public class ServerSurgeryToolComponent : SharedSurgeryToolComponent, IAfterInteract
{
#pragma warning disable 649
[Dependency] private readonly IMapManager _mapManager;
@@ -41,13 +41,13 @@ namespace Content.Server.GameObjects.Components.Weapon.Melee
private BodyManagerComponent _targetCache;
private IEntity _performerCache;
void IAfterAttack.AfterAttack(AfterAttackEventArgs eventArgs)
void IAfterInteract.AfterInteract(AfterInteractEventArgs eventArgs)
{
if (!InteractionChecks.InRangeUnobstructed(eventArgs)) return;
if (eventArgs.Attacked == null)
if (eventArgs.Target == null)
return;
if (eventArgs.Attacked.TryGetComponent<BodySystem.BodyManagerComponent>(out BodySystem.BodyManagerComponent bodyManager))
if (eventArgs.Target.TryGetComponent<BodySystem.BodyManagerComponent>(out BodySystem.BodyManagerComponent bodyManager))
{
_surgeryOptionsCache.Clear();
var toSend = new Dictionary<string, string>();