Clean up StoreSystem (#14027)

This commit is contained in:
Nemanja
2023-02-12 07:39:14 -05:00
committed by GitHub
parent e7b18b33aa
commit 351c53e774
9 changed files with 108 additions and 101 deletions

View File

@@ -19,7 +19,6 @@ using Content.Shared.Bed.Sleep;
using System.Linq;
using Content.Server.Maps;
using Content.Server.Revenant.Components;
using Content.Server.Store.Components;
using Content.Shared.Emag.Systems;
using Content.Shared.FixedPoint;
using Content.Shared.Humanoid;
@@ -29,7 +28,6 @@ using Content.Shared.Mobs.Systems;
using Content.Shared.Revenant.Components;
using Robust.Shared.Physics.Components;
using Robust.Shared.Utility;
using Content.Shared.Humanoid;
namespace Content.Server.Revenant.EntitySystems;
@@ -180,13 +178,10 @@ public sealed partial class RevenantSystem
essence.Harvested = true;
ChangeEssenceAmount(uid, essence.EssenceAmount, component);
if (TryComp<StoreComponent>(uid, out var store))
{
_store.TryAddCurrency(new Dictionary<string, FixedPoint2>()
{ {component.StolenEssenceCurrencyPrototype, essence.EssenceAmount} }, store);
}
_store.TryAddCurrency(new Dictionary<string, FixedPoint2>
{ {component.StolenEssenceCurrencyPrototype, essence.EssenceAmount} }, uid);
if (!TryComp<MobStateComponent>(args.Target, out var mobstate))
if (!HasComp<MobStateComponent>(args.Target))
return;
if (_mobState.IsAlive(args.Target) || _mobState.IsCritical(args.Target))