Add static "IsPowered" method (#8434)
* Add static "IsPowered" method * Use IsPowered in more places Co-authored-by: wrexbe <wrexbe@protonmail.com>
This commit is contained in:
@@ -7,6 +7,7 @@ using Content.Shared.Interaction;
|
||||
using Content.Server.Materials;
|
||||
using Content.Server.Popups;
|
||||
using Content.Server.Power.Components;
|
||||
using Content.Server.Power.EntitySystems;
|
||||
using Content.Server.Stack;
|
||||
using Content.Server.UserInterface;
|
||||
using Robust.Server.GameObjects;
|
||||
@@ -171,7 +172,7 @@ namespace Content.Server.Lathe
|
||||
return;
|
||||
}
|
||||
|
||||
if (TryComp<ApcPowerReceiverComponent>(component.Owner, out var receiver) && !receiver.Powered)
|
||||
if (!this.IsPowered(component.Owner, EntityManager))
|
||||
{
|
||||
FinishProducing(recipe, component, false);
|
||||
return;
|
||||
@@ -247,7 +248,7 @@ namespace Content.Server.Lathe
|
||||
/// </summary>
|
||||
private void UserInterfaceOnOnReceiveMessage(EntityUid uid, LatheComponent component, ServerBoundUserInterfaceMessage message)
|
||||
{
|
||||
if (TryComp<ApcPowerReceiverComponent>(uid, out var receiver) && !receiver.Powered)
|
||||
if (!this.IsPowered(uid, EntityManager))
|
||||
return;
|
||||
|
||||
switch (message.Message)
|
||||
|
||||
Reference in New Issue
Block a user