* The all-in-one hacking solution The thinking man's lockpick The iconic EMAG * emagged medbay's stasis bed * left med, emagged sec' apc * went back to chem, emagged the dispenser * emagged the fax while i was there * had a donut while waiting for emag to charge * i broke into the bridge then announced 'mandatory johnson inspection in medical' * get system instead of dependency * feedback * net suggestion Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> * use EnsureComp and import NetworkedComponent --------- Co-authored-by: deltanedas <user@zenith> Co-authored-by: deltanedas <deltanedas@laptop> Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
This commit is contained in:
@@ -10,6 +10,7 @@ using Content.Shared.Actions;
|
||||
using Content.Shared.Actions.ActionTypes;
|
||||
using Content.Shared.Damage;
|
||||
using Content.Shared.Destructible;
|
||||
using Content.Shared.Emag.Components;
|
||||
using Content.Shared.Emag.Systems;
|
||||
using Content.Shared.Popups;
|
||||
using Content.Shared.Throwing;
|
||||
@@ -133,11 +134,8 @@ namespace Content.Server.VendingMachines
|
||||
|
||||
private void OnEmagged(EntityUid uid, VendingMachineComponent component, ref GotEmaggedEvent args)
|
||||
{
|
||||
if (component.Emagged || component.EmaggedInventory.Count == 0 )
|
||||
return;
|
||||
|
||||
component.Emagged = true;
|
||||
args.Handled = true;
|
||||
// only emag if there are emag-only items
|
||||
args.Handled = component.EmaggedInventory.Count > 0;
|
||||
}
|
||||
|
||||
private void OnDamage(EntityUid uid, VendingMachineComponent component, DamageChangedEvent args)
|
||||
@@ -224,7 +222,7 @@ namespace Content.Server.VendingMachines
|
||||
|
||||
if (TryComp<AccessReaderComponent?>(vendComponent.Owner, out var accessReader))
|
||||
{
|
||||
if (!_accessReader.IsAllowed(sender.Value, accessReader) && !vendComponent.Emagged)
|
||||
if (!_accessReader.IsAllowed(sender.Value, accessReader) && !HasComp<EmaggedComponent>(uid))
|
||||
{
|
||||
_popupSystem.PopupEntity(Loc.GetString("vending-machine-component-try-eject-access-denied"), uid);
|
||||
Deny(uid, vendComponent);
|
||||
@@ -391,7 +389,7 @@ namespace Content.Server.VendingMachines
|
||||
|
||||
private VendingMachineInventoryEntry? GetEntry(string entryId, InventoryType type, VendingMachineComponent component)
|
||||
{
|
||||
if (type == InventoryType.Emagged && component.Emagged)
|
||||
if (type == InventoryType.Emagged && HasComp<EmaggedComponent>(component.Owner))
|
||||
return component.EmaggedInventory.GetValueOrDefault(entryId);
|
||||
|
||||
if (type == InventoryType.Contraband && component.Contraband)
|
||||
|
||||
Reference in New Issue
Block a user