Fix popup spam and audio outside prediction for devour action (#19768)
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user