Replace ComponentManager with EntityManager in StackSystem.
Stacks are the most advanced piece of code in this codebase...
This commit is contained in:
@@ -49,7 +49,7 @@ namespace Content.Server.Stack
|
||||
// Set the output parameter in the event instance to the newly split stack.
|
||||
var entity = EntityManager.SpawnEntity(prototype, spawnPosition);
|
||||
|
||||
if (ComponentManager.TryGetComponent(entity.Uid, out SharedStackComponent? stackComp))
|
||||
if (EntityManager.TryGetComponent(entity.Uid, out SharedStackComponent? stackComp))
|
||||
{
|
||||
// Set the split stack's count.
|
||||
SetCount(entity.Uid, amount, stackComp);
|
||||
@@ -65,7 +65,7 @@ namespace Content.Server.Stack
|
||||
{
|
||||
// Set the output result parameter to the new stack entity...
|
||||
var entity = EntityManager.SpawnEntity(prototype.Spawn, spawnPosition);
|
||||
var stack = ComponentManager.GetComponent<StackComponent>(entity.Uid);
|
||||
var stack = EntityManager.GetComponent<StackComponent>(entity.Uid);
|
||||
|
||||
// And finally, set the correct amount!
|
||||
SetCount(entity.Uid, amount, stack);
|
||||
|
||||
@@ -51,7 +51,7 @@ namespace Content.Shared.Stacks
|
||||
EntityManager.QueueDeleteEntity(uid);
|
||||
|
||||
// Change appearance data.
|
||||
if (ComponentManager.TryGetComponent(uid, out SharedAppearanceComponent? appearance))
|
||||
if (EntityManager.TryGetComponent(uid, out SharedAppearanceComponent? appearance))
|
||||
appearance.SetData(StackVisuals.Actual, component.Count);
|
||||
|
||||
RaiseLocalEvent(uid, new StackCountChangedEvent(old, component.Count), false);
|
||||
@@ -79,7 +79,7 @@ namespace Content.Shared.Stacks
|
||||
|
||||
private void OnStackStarted(EntityUid uid, SharedStackComponent component, ComponentStartup args)
|
||||
{
|
||||
if (!ComponentManager.TryGetComponent(uid, out SharedAppearanceComponent? appearance))
|
||||
if (!EntityManager.TryGetComponent(uid, out SharedAppearanceComponent? appearance))
|
||||
return;
|
||||
|
||||
appearance.SetData(StackVisuals.Actual, component.Count);
|
||||
|
||||
Reference in New Issue
Block a user