Fix double interaction popups (#30452)

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.
This commit is contained in:
metalgearsloth
2024-08-02 11:33:20 +10:00
committed by GitHub
parent e6b67540e4
commit 20cb65f2e6

View 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;