if (ev.Actor == ev.Target)
return;
- // no need to show menu if device is not powered.
- if (!PowerReceiver.IsPowered(ev.Target))
- {
- ShowDeviceNotRespondingPopup(ev.Actor);
- ev.Cancel();
- return;
- }
-
if (TryComp(ev.Actor, out StationAiHeldComponent? aiComp) &&
(!TryComp(ev.Target, out StationAiWhitelistComponent? whitelistComponent) ||
!ValidateAi((ev.Actor, aiComp))))
{
+ // Don't allow the AI to interact with anything that isn't powered.
+ if (!PowerReceiver.IsPowered(ev.Target))
+ {
+ ShowDeviceNotRespondingPopup(ev.Actor);
+ ev.Cancel();
+ return;
+ }
+
+ // Don't allow the AI to interact with anything that it isn't allowed to (ex. AI wire is cut)
if (whitelistComponent is { Enabled: false })
{
ShowDeviceNotRespondingPopup(ev.Actor);
var verb = new AlternativeVerb
{
Text = isOpen ? Loc.GetString("ai-close") : Loc.GetString("ai-open"),
- Act = () =>
+ Act = () =>
{
if (isOpen)
{