ECS Doors (#5887)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
using System.Collections.Generic;
|
||||
using Content.Server.Doors.Components;
|
||||
using Content.Shared.Construction;
|
||||
using Content.Shared.Doors.Components;
|
||||
using Content.Shared.Examine;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Shared.GameObjects;
|
||||
@@ -19,10 +19,10 @@ namespace Content.Server.Construction.Conditions
|
||||
|
||||
public bool Condition(EntityUid uid, IEntityManager entityManager)
|
||||
{
|
||||
if (!entityManager.TryGetComponent(uid, out ServerDoorComponent? doorComponent))
|
||||
if (!entityManager.TryGetComponent(uid, out DoorComponent? doorComponent))
|
||||
return false;
|
||||
|
||||
return doorComponent.IsWeldedShut == Welded;
|
||||
return doorComponent.State == DoorState.Welded;
|
||||
}
|
||||
|
||||
public bool DoExamine(ExaminedEvent args)
|
||||
@@ -31,9 +31,10 @@ namespace Content.Server.Construction.Conditions
|
||||
|
||||
var entMan = IoCManager.Resolve<IEntityManager>();
|
||||
|
||||
if (!entMan.TryGetComponent(entity, out ServerDoorComponent? door)) return false;
|
||||
if (!entMan.TryGetComponent(entity, out DoorComponent? door)) return false;
|
||||
|
||||
if (door.IsWeldedShut != Welded)
|
||||
var isWelded = door.State == DoorState.Welded;
|
||||
if (isWelded != Welded)
|
||||
{
|
||||
if (Welded == true)
|
||||
args.PushMarkup(Loc.GetString("construction-examine-condition-door-weld", ("entityName", entMan.GetComponent<MetaDataComponent>(entity).EntityName)) + "\n");
|
||||
|
||||
Reference in New Issue
Block a user