Files
OldThink/Content.Server/_Honk/Aspects/DeleteVendingMachineAspect.cs

20 lines
717 B
C#
Raw Permalink Normal View History

2024-08-23 02:09:40 +03:00
using Content.Server._White.AspectsSystem.Base;
2024-08-24 14:25:47 +03:00
using Content.Server.GameTicking.Components;
2024-08-23 02:09:40 +03:00
using Content.Server.GameTicking.Rules.Components;
using Content.Shared.VendingMachines;
namespace Content.Server._Honk.Aspects;
public sealed class DeleteVendingMachineAspect : AspectSystem<DeleteVendingMachineComponent>
{
[Dependency] private readonly EntityManager _entityManager = default!;
protected override void Started(EntityUid uid, DeleteVendingMachineComponent component, GameRuleComponent gameRule, GameRuleStartedEvent args)
{
foreach (var entity in _entityManager.EntityQuery<VendingMachineComponent>())
{
_entityManager.DeleteEntity(entity.Owner);
}
}
}