mech bug fixes (#13155)

* mech bug fixes

* struct events

* fug
This commit is contained in:
Nemanja
2022-12-24 16:33:08 -05:00
committed by GitHub
parent 455939afc1
commit 56bdfad912
5 changed files with 46 additions and 11 deletions

View File

@@ -4,6 +4,7 @@ using Content.Server.Atmos.EntitySystems;
using Content.Server.DoAfter;
using Content.Server.Mech.Components;
using Content.Server.Power.Components;
using Content.Server.Tools;
using Content.Server.Wires;
using Content.Shared.Damage;
using Content.Shared.FixedPoint;
@@ -52,6 +53,7 @@ public sealed class MechSystem : SharedMechSystem
SubscribeLocalEvent<MechComponent, DamageChangedEvent>(OnDamageChanged);
SubscribeLocalEvent<MechComponent, MechEquipmentRemoveMessage>(OnRemoveEquipmentMessage);
SubscribeLocalEvent<MechPilotComponent, ToolUserAttemptUseEvent>(OnToolUseAttempt);
SubscribeLocalEvent<MechPilotComponent, InhaleLocationEvent>(OnInhale);
SubscribeLocalEvent<MechPilotComponent, ExhaleLocationEvent>(OnExhale);
SubscribeLocalEvent<MechPilotComponent, AtmosExposedGetAirEvent>(OnExpose);
@@ -137,6 +139,12 @@ public sealed class MechSystem : SharedMechSystem
ToggleMechUi(uid, component);
}
private void OnToolUseAttempt(EntityUid uid, MechPilotComponent component, ref ToolUserAttemptUseEvent args)
{
if (args.Target == component.Mech)
args.Cancelled = true;
}
private void OnAlternativeVerb(EntityUid uid, MechComponent component, GetVerbsEvent<AlternativeVerb> args)
{
if (!args.CanAccess || !args.CanInteract || component.Broken)