Fix for holoparasite's ability to attack the host through mech (#36659)
This commit is contained in:
@@ -10,6 +10,7 @@ using Content.Shared.Hands.EntitySystems;
|
||||
using Content.Shared.IdentityManagement;
|
||||
using Content.Shared.Interaction;
|
||||
using Content.Shared.Interaction.Events;
|
||||
using Content.Shared.Mech.EntitySystems;
|
||||
using Content.Shared.Mobs;
|
||||
using Content.Shared.Popups;
|
||||
using Robust.Shared.Audio.Systems;
|
||||
@@ -56,6 +57,8 @@ namespace Content.Server.Guardian
|
||||
SubscribeLocalEvent<GuardianHostComponent, GuardianToggleActionEvent>(OnPerformAction);
|
||||
|
||||
SubscribeLocalEvent<GuardianComponent, AttackAttemptEvent>(OnGuardianAttackAttempt);
|
||||
|
||||
SubscribeLocalEvent<GuardianHostComponent, MechPilotRelayedEvent<GettingAttackedAttemptEvent>>(OnPilotAttackAttempt);
|
||||
}
|
||||
|
||||
private void OnGuardianShutdown(EntityUid uid, GuardianComponent component, ComponentShutdown args)
|
||||
@@ -144,6 +147,16 @@ namespace Content.Server.Guardian
|
||||
args.Cancel();
|
||||
}
|
||||
|
||||
private void OnPilotAttackAttempt(Entity<GuardianHostComponent> uid, ref MechPilotRelayedEvent<GettingAttackedAttemptEvent> args)
|
||||
{
|
||||
if (args.Args.Cancelled)
|
||||
return;
|
||||
|
||||
_popupSystem.PopupCursor(Loc.GetString("guardian-attack-host"), args.Args.Attacker, PopupType.LargeCaution);
|
||||
|
||||
args.Args.Cancelled = true;
|
||||
}
|
||||
|
||||
public void ToggleGuardian(EntityUid user, GuardianHostComponent hostComponent)
|
||||
{
|
||||
if (!TryComp<GuardianComponent>(hostComponent.HostedGuardian, out var guardianComponent))
|
||||
|
||||
Reference in New Issue
Block a user