Фиксы культа
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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";
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user