make tinned foods use openable (#19884)

Co-authored-by: deltanedas <@deltanedas:kde.org>
This commit is contained in:
deltanedas
2023-10-07 01:35:32 +01:00
committed by GitHub
parent 2079dc05ff
commit 6af7c90b73
23 changed files with 196 additions and 229 deletions

View File

@@ -0,0 +1,17 @@
using Content.Server.Nutrition.EntitySystems;
namespace Content.Server.Destructible.Thresholds.Behaviors;
/// <summary>
/// Causes the drink/food to open when the destruction threshold is reached.
/// If it is already open nothing happens.
/// </summary>
[DataDefinition]
public sealed partial class OpenBehavior : IThresholdBehavior
{
public void Execute(EntityUid uid, DestructibleSystem system, EntityUid? cause = null)
{
var openable = EntitySystem.Get<OpenableSystem>();
openable.TryOpen(uid);
}
}