]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix double interaction popups (#30452)
authormetalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
Fri, 2 Aug 2024 01:33:20 +0000 (11:33 +1000)
committerGitHub <noreply@github.com>
Fri, 2 Aug 2024 01:33:20 +0000 (11:33 +1000)
The issue is it plays the "you hug xyz" to everyone in range as well as the target client so they overlap. IDK if anything else is broken by this but this control flow is pretty bad so I wouldn't be surprised.

Content.Shared/Interaction/InteractionPopupSystem.cs

index d956ff3d95399a5c0f2335c51eb3647050454cd5..2a742d4211b6cf0bfd043e8cfa8ef9d027ad8e68 100644 (file)
@@ -113,7 +113,7 @@ public sealed class InteractionPopupSystem : EntitySystem
                 Spawn(component.InteractFailureSpawn, _transform.GetMapCoordinates(uid));
         }
 
-        if (component.MessagePerceivedByOthers != null)
+        if (!string.IsNullOrEmpty(component.MessagePerceivedByOthers))
         {
             var msgOthers = Loc.GetString(component.MessagePerceivedByOthers,
                 ("user", Identity.Entity(user, EntityManager)), ("target", Identity.Entity(uid, EntityManager)));
@@ -131,7 +131,7 @@ public sealed class InteractionPopupSystem : EntitySystem
             return;
         }
 
-        _popupSystem.PopupPredicted(msg, uid, user);
+        _popupSystem.PopupClient(msg, uid, user);
 
         if (sfx == null)
             return;