From d3102dbf960bf4df15d4f22861852cd624863ad7 Mon Sep 17 00:00:00 2001 From: zumorica Date: Thu, 21 May 2020 19:44:49 +0200 Subject: [PATCH] Remove server-side RefreshInHands, refresh them on component state update --- .../Components/Items/ClientHandsComponent.cs | 4 +--- .../Components/GUI/ServerHandsComponent.cs | 5 ----- .../GameObjects/Components/Items/IHandsComponent.cs | 5 ----- .../Components/Items/SharedHandsComponent.cs | 12 ------------ .../Prototypes/Entities/Items/Weapons/security.yml | 2 +- 5 files changed, 2 insertions(+), 26 deletions(-) diff --git a/Content.Client/GameObjects/Components/Items/ClientHandsComponent.cs b/Content.Client/GameObjects/Components/Items/ClientHandsComponent.cs index 7ef5ab94fc..f7f1e3c815 100644 --- a/Content.Client/GameObjects/Components/Items/ClientHandsComponent.cs +++ b/Content.Client/GameObjects/Components/Items/ClientHandsComponent.cs @@ -101,6 +101,7 @@ namespace Content.Client.GameObjects ActiveIndex = cast.ActiveIndex; _gui?.UpdateHandIcons(); + RefreshInHands(); } private void _setHand(string hand, IEntity entity) @@ -190,9 +191,6 @@ namespace Content.Client.GameObjects case PlayerDetachedMsg _: _gui.Parent?.RemoveChild(_gui); break; - case RefreshInHandsMsg _: - RefreshInHands(); - break; } } diff --git a/Content.Server/GameObjects/Components/GUI/ServerHandsComponent.cs b/Content.Server/GameObjects/Components/GUI/ServerHandsComponent.cs index b336e1b9c0..ab265e3693 100644 --- a/Content.Server/GameObjects/Components/GUI/ServerHandsComponent.cs +++ b/Content.Server/GameObjects/Components/GUI/ServerHandsComponent.cs @@ -406,11 +406,6 @@ namespace Content.Server.GameObjects return hands.ContainsKey(index); } - public void RefreshInHands() - { - SendNetworkMessage(new RefreshInHandsMsg()); - } - /// /// Get the name of the slot passed to the inventory component. /// diff --git a/Content.Server/Interfaces/GameObjects/Components/Items/IHandsComponent.cs b/Content.Server/Interfaces/GameObjects/Components/Items/IHandsComponent.cs index e1154fb4f9..27a11740f7 100644 --- a/Content.Server/Interfaces/GameObjects/Components/Items/IHandsComponent.cs +++ b/Content.Server/Interfaces/GameObjects/Components/Items/IHandsComponent.cs @@ -191,11 +191,6 @@ namespace Content.Server.Interfaces.GameObjects /// True if the hand exists, false otherwise. bool HasHand(string index); - /// - /// Refresh all in-hands sprites. - /// - void RefreshInHands(); - void HandleSlotModifiedMaybe(ContainerModifiedMessage message); } } diff --git a/Content.Shared/GameObjects/Components/Items/SharedHandsComponent.cs b/Content.Shared/GameObjects/Components/Items/SharedHandsComponent.cs index 617c54e983..dc3604eae6 100644 --- a/Content.Shared/GameObjects/Components/Items/SharedHandsComponent.cs +++ b/Content.Shared/GameObjects/Components/Items/SharedHandsComponent.cs @@ -75,16 +75,4 @@ namespace Content.Shared.GameObjects Index = index; } } - - /// - /// A message that tells the client to refresh in-hands. - /// - [Serializable, NetSerializable] - public class RefreshInHandsMsg : ComponentMessage - { - public RefreshInHandsMsg() - { - Directed = true; - } - } } diff --git a/Resources/Prototypes/Entities/Items/Weapons/security.yml b/Resources/Prototypes/Entities/Items/Weapons/security.yml index 646b5b605a..cc0a69562b 100644 --- a/Resources/Prototypes/Entities/Items/Weapons/security.yml +++ b/Resources/Prototypes/Entities/Items/Weapons/security.yml @@ -12,7 +12,7 @@ state: stunbaton_off - type: Stunbaton - damage: 0.25 + damage: 1 range: 0.75 arcwidth: 0 arc: default