Fix borgs being able to emag themselves (#24748)
* Fix self emagging borgs * Add popup on self emag failure.
This commit is contained in:
@@ -21,6 +21,14 @@ public abstract class SharedSiliconLawSystem : EntitySystem
|
|||||||
|
|
||||||
protected virtual void OnAttemptEmag(EntityUid uid, EmagSiliconLawComponent component, ref OnAttemptEmagEvent args)
|
protected virtual void OnAttemptEmag(EntityUid uid, EmagSiliconLawComponent component, ref OnAttemptEmagEvent args)
|
||||||
{
|
{
|
||||||
|
//prevent self emagging
|
||||||
|
if (uid == args.UserUid)
|
||||||
|
{
|
||||||
|
_popup.PopupClient(Loc.GetString("law-emag-cannot-emag-self"), uid, args.UserUid);
|
||||||
|
args.Handled = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (component.RequireOpenPanel &&
|
if (component.RequireOpenPanel &&
|
||||||
TryComp<WiresPanelComponent>(uid, out var panel) &&
|
TryComp<WiresPanelComponent>(uid, out var panel) &&
|
||||||
!panel.Open)
|
!panel.Open)
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ laws-owner-spider-clan = Spider Clan members
|
|||||||
law-emag-custom = Only {$name} and people they designate as such are {$title}.
|
law-emag-custom = Only {$name} and people they designate as such are {$title}.
|
||||||
law-emag-secrecy = You must maintain the secrecy of any orders given by {$faction} except when doing so would conflict with any previous law.
|
law-emag-secrecy = You must maintain the secrecy of any orders given by {$faction} except when doing so would conflict with any previous law.
|
||||||
law-emag-require-panel = The panel must be open to use the EMAG.
|
law-emag-require-panel = The panel must be open to use the EMAG.
|
||||||
|
law-emag-cannot-emag-self = You cannot use the EMAG on yourself.
|
||||||
|
|
||||||
laws-ui-menu-title = Laws
|
laws-ui-menu-title = Laws
|
||||||
laws-ui-law-header = Law {$id}
|
laws-ui-law-header = Law {$id}
|
||||||
|
|||||||
Reference in New Issue
Block a user