Weldable cleanup (#19809)
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using Content.Server.Storage.Components;
|
||||
using Content.Shared.Construction;
|
||||
using Content.Shared.Examine;
|
||||
using Content.Shared.Tools.Systems;
|
||||
using JetBrains.Annotations;
|
||||
|
||||
namespace Content.Server.Construction.Conditions
|
||||
@@ -14,10 +15,7 @@ namespace Content.Server.Construction.Conditions
|
||||
|
||||
public bool Condition(EntityUid uid, IEntityManager entityManager)
|
||||
{
|
||||
if (!entityManager.TryGetComponent(uid, out EntityStorageComponent? entityStorageComponent))
|
||||
return false;
|
||||
|
||||
return entityStorageComponent.IsWeldedShut == Welded;
|
||||
return entityManager.System<WeldableSystem>().IsWelded(uid);
|
||||
}
|
||||
|
||||
public bool DoExamine(ExaminedEvent args)
|
||||
@@ -25,11 +23,12 @@ namespace Content.Server.Construction.Conditions
|
||||
var entMan = IoCManager.Resolve<IEntityManager>();
|
||||
var entity = args.Examined;
|
||||
|
||||
if (!entMan.TryGetComponent(entity, out EntityStorageComponent? entityStorage)) return false;
|
||||
if (!entMan.HasComponent<EntityStorageComponent>(entity))
|
||||
return false;
|
||||
|
||||
var metaData = entMan.GetComponent<MetaDataComponent>(entity);
|
||||
|
||||
if (entityStorage.IsWeldedShut != Welded)
|
||||
if (entMan.System<WeldableSystem>().IsWelded(entity) != Welded)
|
||||
{
|
||||
if (Welded)
|
||||
args.PushMarkup(Loc.GetString("construction-examine-condition-door-weld", ("entityName", metaData.EntityName)) + "\n");
|
||||
|
||||
Reference in New Issue
Block a user