]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix storage area pickup sound playing multiple times (#32397)
authormetalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
Fri, 27 Sep 2024 07:09:17 +0000 (17:09 +1000)
committerGitHub <noreply@github.com>
Fri, 27 Sep 2024 07:09:17 +0000 (17:09 +1000)
Content.Shared/Storage/EntitySystems/SharedStorageSystem.cs

index ca4b788867f5340c7f7c8cdc3f6f6120faeaaa11..5c1e2bcfad1966db1f86786e5b2cc9177f722ca7 100644 (file)
@@ -547,7 +547,7 @@ public abstract class SharedStorageSystem : EntitySystem
 
             var angle = targetXform.LocalRotation;
 
-            if (PlayerInsertEntityInWorld((uid, component), args.Args.User, entity))
+            if (PlayerInsertEntityInWorld((uid, component), args.Args.User, entity, playSound: false))
             {
                 successfullyInserted.Add(entity);
                 successfullyInsertedPositions.Add(position);
@@ -1040,12 +1040,12 @@ public abstract class SharedStorageSystem : EntitySystem
     /// <param name="player">The player to insert an entity with</param>
     /// <param name="toInsert"></param>
     /// <returns>true if inserted, false otherwise</returns>
-    public bool PlayerInsertEntityInWorld(Entity<StorageComponent?> uid, EntityUid player, EntityUid toInsert)
+    public bool PlayerInsertEntityInWorld(Entity<StorageComponent?> uid, EntityUid player, EntityUid toInsert, bool playSound = true)
     {
         if (!Resolve(uid, ref uid.Comp) || !_interactionSystem.InRangeUnobstructed(player, uid.Owner))
             return false;
 
-        if (!Insert(uid, toInsert, out _, user: player, uid.Comp))
+        if (!Insert(uid, toInsert, out _, user: player, uid.Comp, playSound: playSound))
         {
             _popupSystem.PopupClient(Loc.GetString("comp-storage-cant-insert"), uid, player);
             return false;