ActSystem and Destruction Threshold Behaviors use EntityUid.
This commit is contained in:
@@ -19,8 +19,10 @@ namespace Content.Server.Destructible.Thresholds.Behaviors
|
||||
[DataField("spawn")]
|
||||
public Dictionary<string, MinMax> Spawn { get; set; } = new();
|
||||
|
||||
public void Execute(IEntity owner, DestructibleSystem system)
|
||||
public void Execute(EntityUid owner, DestructibleSystem system, IEntityManager entityManager)
|
||||
{
|
||||
var position = entityManager.GetComponent<TransformComponent>(owner).MapPosition;
|
||||
|
||||
foreach (var (entityId, minMax) in Spawn)
|
||||
{
|
||||
var count = minMax.Min >= minMax.Max
|
||||
@@ -31,7 +33,7 @@ namespace Content.Server.Destructible.Thresholds.Behaviors
|
||||
|
||||
if (EntityPrototypeHelpers.HasComponent<StackComponent>(entityId))
|
||||
{
|
||||
var spawned = owner.EntityManager.SpawnEntity(entityId, owner.Transform.MapPosition);
|
||||
var spawned = entityManager.SpawnEntity(entityId, position);
|
||||
var stack = spawned.GetComponent<StackComponent>();
|
||||
EntitySystem.Get<StackSystem>().SetCount(spawned.Uid, count, stack);
|
||||
spawned.RandomOffset(0.5f);
|
||||
@@ -40,7 +42,7 @@ namespace Content.Server.Destructible.Thresholds.Behaviors
|
||||
{
|
||||
for (var i = 0; i < count; i++)
|
||||
{
|
||||
var spawned = owner.EntityManager.SpawnEntity(entityId, owner.Transform.MapPosition);
|
||||
var spawned = entityManager.SpawnEntity(entityId, position);
|
||||
spawned.RandomOffset(0.5f);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user