From ab8b3ecec2a139069c3ee76d5961f1b5758edae2 Mon Sep 17 00:00:00 2001 From: geraeumig <171753363+geraeumig@users.noreply.github.com> Date: Thu, 13 Jun 2024 04:23:15 +0200 Subject: [PATCH] Fix magazine sprites after Auto Eject (#28859) Co-authored-by: geraeumig --- .../Weapons/Ranged/Systems/SharedGunSystem.Magazine.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.Magazine.cs b/Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.Magazine.cs index 9eb290ab65..61a4820e5b 100644 --- a/Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.Magazine.cs +++ b/Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.Magazine.cs @@ -146,13 +146,14 @@ public abstract partial class SharedGunSystem private void FinaliseMagazineTakeAmmo(EntityUid uid, MagazineAmmoProviderComponent component, int count, int capacity, EntityUid? user, AppearanceComponent? appearance) { // If no ammo then check for autoeject - if (component.AutoEject && count == 0) + var ejectMag = component.AutoEject && count == 0; + if (ejectMag) { EjectMagazine(uid, component); Audio.PlayPredicted(component.SoundAutoEject, uid, user); } - UpdateMagazineAppearance(uid, appearance, true, count, capacity); + UpdateMagazineAppearance(uid, appearance, !ejectMag, count, capacity); } private void UpdateMagazineAppearance(EntityUid uid, MagazineAmmoProviderComponent component, EntityUid magEnt)