Fix riot shield audio and popup spam (#21881)
This commit is contained in:
@@ -19,6 +19,7 @@ using Robust.Shared.Physics.Components;
|
||||
using Robust.Shared.Physics.Systems;
|
||||
using Robust.Shared.Player;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Timing;
|
||||
using Robust.Shared.Utility;
|
||||
|
||||
namespace Content.Shared.Blocking;
|
||||
@@ -36,6 +37,7 @@ public sealed partial class BlockingSystem : EntitySystem
|
||||
[Dependency] private readonly SharedPhysicsSystem _physics = default!;
|
||||
[Dependency] private readonly ExamineSystemShared _examine = default!;
|
||||
[Dependency] private readonly INetManager _net = default!;
|
||||
[Dependency] private readonly IGameTiming _gameTiming = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -195,8 +197,12 @@ public sealed partial class BlockingSystem : EntitySystem
|
||||
return false;
|
||||
}
|
||||
_actionsSystem.SetToggled(component.BlockingToggleActionEntity, true);
|
||||
_popupSystem.PopupEntity(msgUser, user, user);
|
||||
_popupSystem.PopupEntity(msgOther, user, Filter.PvsExcept(user), true);
|
||||
if (_gameTiming.IsFirstTimePredicted)
|
||||
{
|
||||
_popupSystem.PopupEntity(msgOther, user, Filter.PvsExcept(user), true);
|
||||
if(_gameTiming.InPrediction)
|
||||
_popupSystem.PopupEntity(msgUser, user, user);
|
||||
}
|
||||
}
|
||||
|
||||
if (TryComp<PhysicsComponent>(user, out var physicsComponent))
|
||||
@@ -259,8 +265,12 @@ public sealed partial class BlockingSystem : EntitySystem
|
||||
_actionsSystem.SetToggled(component.BlockingToggleActionEntity, false);
|
||||
_fixtureSystem.DestroyFixture(user, BlockingComponent.BlockFixtureID, body: physicsComponent);
|
||||
_physics.SetBodyType(user, blockingUserComponent.OriginalBodyType, body: physicsComponent);
|
||||
_popupSystem.PopupEntity(msgUser, user, user);
|
||||
_popupSystem.PopupEntity(msgOther, user, Filter.PvsExcept(user), true);
|
||||
if (_gameTiming.IsFirstTimePredicted)
|
||||
{
|
||||
_popupSystem.PopupEntity(msgOther, user, Filter.PvsExcept(user), true);
|
||||
if(_gameTiming.InPrediction)
|
||||
_popupSystem.PopupEntity(msgUser, user, user);
|
||||
}
|
||||
}
|
||||
|
||||
component.IsBlocking = false;
|
||||
|
||||
Reference in New Issue
Block a user