Фикс блока ближних атак (#801)
This commit is contained in:
@@ -11,6 +11,7 @@ using Content.Shared.Weapons.Melee;
|
||||
using Content.Shared.Weapons.Melee.Events;
|
||||
using Robust.Shared.Audio.Systems;
|
||||
using Robust.Shared.Timing;
|
||||
using Content.Shared.Mobs.Systems;
|
||||
|
||||
namespace Content.Shared._White.Blocking;
|
||||
|
||||
@@ -21,6 +22,7 @@ public sealed class MeleeBlockSystem : EntitySystem
|
||||
[Dependency] private readonly SharedAudioSystem _audio = default!;
|
||||
[Dependency] private readonly SharedPopupSystem _popupSystem = default!;
|
||||
[Dependency] private readonly StatusEffectsSystem _statusEffect = default!;
|
||||
[Dependency] private readonly MobStateSystem _mobStateSystem = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -76,6 +78,9 @@ public sealed class MeleeBlockSystem : EntitySystem
|
||||
if (TryComp(uid.Value, out ItemToggleComponent? toggle) && !toggle.Activated)
|
||||
return;
|
||||
|
||||
if (!_mobStateSystem.IsAlive(ent))
|
||||
return;
|
||||
|
||||
_audio.PlayPredicted(block.BlockSound, ent, args.Attacker);
|
||||
_popupSystem.PopupPredicted(Loc.GetString("melee-block-event-blocked"), ent, args.Attacker);
|
||||
_damageable.TryChangeDamage(uid.Value, args.Damage);
|
||||
|
||||
Reference in New Issue
Block a user