From 8410fc239c3812e33d2171fb55d60c315339fb72 Mon Sep 17 00:00:00 2001 From: Vera Aguilera Puerto Date: Sun, 18 Jul 2021 14:59:40 +0200 Subject: [PATCH] Fix handheld instruments not working --- Content.Server/Instruments/InstrumentComponent.cs | 4 +++- Resources/Changelog/Parts/instrument.yml | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 Resources/Changelog/Parts/instrument.yml diff --git a/Content.Server/Instruments/InstrumentComponent.cs b/Content.Server/Instruments/InstrumentComponent.cs index c3484bbc20..499d0a3e6d 100644 --- a/Content.Server/Instruments/InstrumentComponent.cs +++ b/Content.Server/Instruments/InstrumentComponent.cs @@ -307,7 +307,9 @@ namespace Content.Server.Instruments { if (!user.TryGetComponent(out ActorComponent? actor)) return; - if (InstrumentPlayer != null || !EntitySystem.Get().CanInteract(user)) return; + if ((!Handheld && InstrumentPlayer != null) + || (Handheld && actor.PlayerSession != InstrumentPlayer) + || !EntitySystem.Get().CanInteract(user)) return; InstrumentPlayer = actor.PlayerSession; OpenUserInterface(InstrumentPlayer); diff --git a/Resources/Changelog/Parts/instrument.yml b/Resources/Changelog/Parts/instrument.yml new file mode 100644 index 0000000000..69629bb1e9 --- /dev/null +++ b/Resources/Changelog/Parts/instrument.yml @@ -0,0 +1,4 @@ +author: Zumorica +changes: + - type: Fix # One of the following: Add, Remove, Tweak, Fix + message: Fixes handheld instruments not working.