Fix windoor deconstruction (#6581)

This commit is contained in:
Leon Friedrich
2022-02-14 15:44:21 +13:00
committed by GitHub
parent 177e14c8fd
commit 9fecdcdde3
4 changed files with 11 additions and 33 deletions

View File

@@ -5,7 +5,6 @@ using Content.Server.Construction;
using Content.Server.Construction.Components;
using Content.Server.Tools;
using Content.Server.Tools.Components;
using Content.Server.Doors.Components;
using Content.Shared.Access.Components;
using Content.Shared.Access.Systems;
using Content.Shared.Doors;
@@ -15,8 +14,6 @@ using Content.Shared.Interaction;
using Content.Shared.Tag;
using Robust.Shared.Audio;
using Robust.Shared.Containers;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Physics.Dynamics;
using Robust.Shared.Player;
using System.Linq;
@@ -154,7 +151,9 @@ public sealed class DoorSystem : SharedDoorSystem
RaiseLocalEvent(target, canEv, false);
if (canEv.Cancelled)
return false;
// mark handled, as airlock component will cancel after generating a pop-up & you don't want to pry a tile
// under a windoor.
return true;
var modEv = new DoorGetPryTimeModifierEvent();
RaiseLocalEvent(target, modEv, false);
@@ -293,19 +292,16 @@ public sealed class DoorSystem : SharedDoorSystem
var container = uid.EnsureContainer<Container>("board", out var existed);
/* // TODO ShadowCommander: Re-enable when access is added to boards. Requires map update.
if (existed)
{
// We already contain a board. Note: We don't check if it's the right one!
if (container.ContainedEntities.Count != 0)
return;
if (existed & container.ContainedEntities.Count != 0)
{
// We already contain a board. Note: We don't check if it's the right one!
return;
}
var board = Owner.EntityManager.SpawnEntity(_boardPrototype, Owner.Transform.Coordinates);
var board = EntityManager.SpawnEntity(door.BoardPrototype, Transform(uid).Coordinates);
if(!container.Insert(board))
Logger.Warning($"Couldn't insert board {board} into door {Owner}!");
*/
Logger.Warning($"Couldn't insert board {ToPrettyString(board)} into door {ToPrettyString(uid)}!");
}
}

View File

@@ -76,6 +76,7 @@
- type: Door
canCrush: false
weldable: false
board: DoorElectronics
openSound:
path: /Audio/Machines/windoor_open.ogg
closeSound:

View File

@@ -76,32 +76,15 @@
- node: airlock
entity: Airlock
edges:
- to: wired
- to: wired #TODO DOOR ELECTRONICS. If door electronics ever govern access permissions, this step should probably be further down? It makes it too easy to swap permissions around. See also windoor.
conditions:
- !type:EntityAnchored {}
- !type:DoorWelded {}
- !type:AirlockBolted
value: false
- !type:WirePanel {}
- !type:ContainerNotEmpty # TODO ShadowCommander: Remove when map gets updated
container: board
completed:
- !type:EmptyAllContainers {}
steps:
- tool: Prying
doAfter: 5
- to: wired # TODO ShadowCommander: Remove when board spawning is implemented in ServerDoorComponent.cs. Needs a map update.
conditions:
- !type:EntityAnchored {}
- !type:DoorWelded {}
- !type:AirlockBolted
value: false
- !type:WirePanel {}
- !type:ContainerEmpty
container: board
completed:
- !type:SpawnPrototype
prototype: DoorElectronics
steps:
- tool: Prying
doAfter: 5

View File

@@ -112,8 +112,6 @@
- !type:AirlockBolted
value: false
- !type:WirePanel {}
- !type:ContainerNotEmpty # TODO ShadowCommander: Remove when map gets updated
container: board
completed:
- !type:EmptyAllContainers {}
steps: