Merge pull request #1660 from juliangiebel/bug/anchoring-reagent-dispenser
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user