Merge pull request #1660 from juliangiebel/bug/anchoring-reagent-dispenser

This commit is contained in:
Pieter-Jan Briers
2020-08-17 17:54:21 +02:00
committed by GitHub
4 changed files with 13 additions and 2 deletions

View File

@@ -14,6 +14,8 @@ namespace Content.Server.GameObjects.Components
{
public override string Name => "Anchorable";
int IInteractUsing.Priority => 1;
/// <summary>
/// Checks if a tool can change the anchored status.
/// </summary>

View File

@@ -1,4 +1,4 @@
using Content.Server.GameObjects.Components.GUI;
using Content.Server.GameObjects.Components.GUI;
using Content.Shared.GameObjects.Components;
using Content.Shared.Interfaces.GameObjects.Components;
using Robust.Shared.GameObjects;
@@ -12,6 +12,8 @@ namespace Content.Server.GameObjects.Components
private bool _isPlaceable;
public bool IsPlaceable { get => _isPlaceable; set => _isPlaceable = value; }
int IInteractUsing.Priority => 1;
public override void ExposeData(ObjectSerializer serializer)
{
base.ExposeData(serializer);

View File

@@ -447,7 +447,7 @@ namespace Content.Server.GameObjects.EntitySystems.Click
return;
}
var attackBys = attacked.GetAllComponents<IInteractUsing>().ToList();
var attackBys = attacked.GetAllComponents<IInteractUsing>().OrderByDescending(x => x.Priority);
var attackByEventArgs = new InteractUsingEventArgs
{
User = user, ClickLocation = clickLocation, Using = weapon, Target = attacked

View File

@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using JetBrains.Annotations;
using Robust.Shared.GameObjects;
using Robust.Shared.Interfaces.GameObjects;
@@ -12,6 +13,12 @@ namespace Content.Shared.Interfaces.GameObjects.Components
/// </summary>
public interface IInteractUsing
{
/// <summary>
/// The interaction priority. Higher numbers get called first.
/// </summary>
/// <value>Priority defaults to 0</value>
int Priority => 0;
/// <summary>
/// Called when using one object on another when user is in range of the target entity.
/// </summary>