Fix some things setting StackComponent count manually.
This commit is contained in:
@@ -3,6 +3,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using Content.Server.GameObjects.Components.Stack;
|
||||
using Content.Server.GameObjects.EntitySystems;
|
||||
using Content.Shared.GameObjects.EntitySystems;
|
||||
using Content.Shared.Utility;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Serialization.Manager.Attributes;
|
||||
@@ -32,8 +33,7 @@ namespace Content.Server.GameObjects.Components.Destructible.Thresholds.Behavior
|
||||
if (EntityPrototypeHelpers.HasComponent<StackComponent>(entityId))
|
||||
{
|
||||
var spawned = owner.EntityManager.SpawnEntity(entityId, owner.Transform.MapPosition);
|
||||
var stack = spawned.GetComponent<StackComponent>();
|
||||
stack.Count = count;
|
||||
owner.EntityManager.EventBus.RaiseLocalEvent(spawned.Uid, new StackChangeCountEvent(count), false);
|
||||
spawned.RandomOffset(0.5f);
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user