bugfixes and ENG OBT preparation (#1015)

* bugfixes and OBT preparation

* Update CP14CargoSystem.cs
This commit is contained in:
Ed
2025-03-12 20:14:50 +03:00
committed by GitHub
parent 18373b65ac
commit dcacd8f8da
7 changed files with 1978 additions and 4232 deletions

View File

@@ -7,6 +7,7 @@ using Content.Shared._CP14.Cargo;
using Content.Shared._CP14.Cargo.Prototype;
using Content.Shared._CP14.Currency;
using Content.Shared.Paper;
using Content.Shared.Stacks;
using Content.Shared.Throwing;
using Robust.Server.GameObjects;
using Robust.Shared.Prototypes;
@@ -218,7 +219,13 @@ public sealed partial class CP14CargoSystem : CP14SharedCargoSystem
{
if (TryComp<CP14CurrencyComponent>(stored, out var currency))
{
cash += currency.Currency;
//fix currency calculation
var c = currency.Currency;
if (TryComp<StackComponent>(stored, out var stack))
c *= stack.Count;
cash += c;
QueueDel(stored);
}
}

View File

@@ -19,10 +19,11 @@ public sealed partial class CP14UniqueLootSystem : EntitySystem
{
base.Initialize();
SubscribeLocalEvent<RoundStartingEvent>(OnRoundStart);
SubscribeLocalEvent<RoundRestartCleanupEvent>(OnCleanup);
SubscribeLocalEvent<CP14UniqueLootSpawnerComponent, MapInitEvent>(OnMapInit);
RefreshUniqueLoot();
}
private void OnMapInit(Entity<CP14UniqueLootSpawnerComponent> ent, ref MapInitEvent args)
@@ -39,14 +40,10 @@ public sealed partial class CP14UniqueLootSystem : EntitySystem
QueueDel(ent);
}
private void OnRoundStart(RoundStartingEvent ev)
{
RefreshUniqueLoot();
}
private void OnCleanup(RoundRestartCleanupEvent ev)
{
_uniqueLootCount.Clear();
RefreshUniqueLoot();
}
private void RefreshUniqueLoot()