Фиксы культа

This commit is contained in:
Aviu00
2024-01-28 07:24:34 +03:00
parent 0b5f9625ba
commit e81367d2d0
12 changed files with 42 additions and 62 deletions

View File

@@ -306,16 +306,14 @@ public sealed partial class CultSystem : EntitySystem
private void HandleCollision(EntityUid uid, CultRuneBaseComponent component, ref StartCollideEvent args)
{
if (!TryComp<SolutionContainerManagerComponent>(args.OtherEntity, out var solution))
if (!TryComp<SolutionContainerManagerComponent>(args.OtherEntity, out var solution) || solution.Solutions == null)
{
return;
}
#pragma warning disable RA0002
if (solution.Solutions!.TryGetValue("vapor", out var vapor) && vapor.Contents.Any(x => x.Reagent.Prototype == "HolyWater"))
if (solution.Solutions.TryGetValue("vapor", out var vapor) && vapor.Contents.Any(x => x.Reagent.Prototype == "HolyWater"))
{
Del(uid);
}
#pragma warning restore RA0002
}
//Erasing end

View File

@@ -1,11 +0,0 @@
namespace Content.Server.White.Cult.Structures;
[RegisterComponent]
public sealed partial class RunicGirderComponent : Component
{
[ViewVariables(VVAccess.ReadOnly)]
public string UsedItemID = "RitualDagger";
[ViewVariables(VVAccess.ReadOnly)]
public string DropItemID = "CultRunicMetal1";
}

View File

@@ -1,30 +0,0 @@
using Content.Shared.Interaction;
using Content.Shared.White.Cult;
namespace Content.Server.White.Cult.Structures;
public sealed class RunicGirderSystem : EntitySystem
{
[Dependency] private readonly EntityManager _entMan = default!;
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<RunicGirderComponent, AfterInteractUsingEvent>(OnInteract);
}
private void OnInteract(EntityUid uid, RunicGirderComponent component, AfterInteractUsingEvent args)
{
if (!HasComp<CultistComponent>(args.User))
return;
if (MetaData(args.Used).EntityPrototype?.ID != component.UsedItemID)
return;
if (args.Target == null)
return;
var pos = Transform(args.Target.Value).Coordinates;
_entMan.DeleteEntity(args.Target.Value);
_entMan.SpawnEntity(component.DropItemID, pos);
}
}