more component ref removal + combining server/client comps (#13178)

Co-authored-by: DrSmugleaf <DrSmugleaf@users.noreply.github.com>
This commit is contained in:
Nemanja
2022-12-24 23:28:21 -05:00
committed by GitHub
parent fddcc0cece
commit faca40b8d5
78 changed files with 504 additions and 643 deletions

View File

@@ -26,7 +26,7 @@ namespace Content.Server.Stack
SubscribeLocalEvent<StackComponent, GetVerbsEvent<AlternativeVerb>>(OnStackAlternativeInteract);
}
public override void SetCount(EntityUid uid, int amount, SharedStackComponent? component = null)
public override void SetCount(EntityUid uid, int amount, StackComponent? component = null)
{
if (!Resolve(uid, ref component, false))
return;
@@ -41,7 +41,7 @@ namespace Content.Server.Stack
/// <summary>
/// Try to split this stack into two. Returns a non-null <see cref="Robust.Shared.GameObjects.EntityUid"/> if successful.
/// </summary>
public EntityUid? Split(EntityUid uid, int amount, EntityCoordinates spawnPosition, SharedStackComponent? stack = null)
public EntityUid? Split(EntityUid uid, int amount, EntityCoordinates spawnPosition, StackComponent? stack = null)
{
if (!Resolve(uid, ref stack))
return null;
@@ -61,7 +61,7 @@ namespace Content.Server.Stack
// Set the output parameter in the event instance to the newly split stack.
var entity = Spawn(prototype, spawnPosition);
if (TryComp(entity, out SharedStackComponent? stackComp))
if (TryComp(entity, out StackComponent? stackComp))
{
// Set the split stack's count.
SetCount(entity, amount, stackComp);