Fix popup spam and audio outside prediction for devour action (#19768)

This commit is contained in:
DrSmugleaf
2023-09-02 18:59:36 -07:00
committed by GitHub
parent 5ca7d257cc
commit eadf6e3fe6

View File

@@ -1,10 +1,10 @@
using Content.Shared.DoAfter;
using Content.Shared.Mobs.Components;
using Content.Shared.Mobs;
using Robust.Shared.Containers;
using Content.Server.Devour.Components;
using Content.Shared.Actions;
using Content.Shared.DoAfter;
using Content.Shared.Mobs;
using Content.Shared.Mobs.Components;
using Content.Shared.Popups;
using Robust.Shared.Containers;
using Robust.Shared.Serialization;
namespace Content.Shared.Devour;
@@ -61,17 +61,17 @@ public abstract class SharedDevourSystem : EntitySystem
});
break;
default:
_popupSystem.PopupEntity(Loc.GetString("devour-action-popup-message-fail-target-alive"), uid, uid);
_popupSystem.PopupClient(Loc.GetString("devour-action-popup-message-fail-target-alive"), uid,uid);
break;
}
return;
}
_popupSystem.PopupEntity(Loc.GetString("devour-action-popup-message-structure"), uid, uid);
_popupSystem.PopupClient(Loc.GetString("devour-action-popup-message-structure"), uid, uid);
if (component.SoundStructureDevour != null)
_audioSystem.PlayPvs(component.SoundStructureDevour, uid, component.SoundStructureDevour.Params);
_audioSystem.PlayPredicted(component.SoundStructureDevour, uid, uid, component.SoundStructureDevour.Params);
_doAfterSystem.TryStartDoAfter(new DoAfterArgs(uid, component.StructureDevourTime, new DevourDoAfterEvent(), uid, target: target, used: uid)
{