Trading content (#1010)
* reroll positions * more trading content * bugfixes * more content * guidebook uodate * Update buy.yml
This commit is contained in:
@@ -5,6 +5,7 @@ using Content.Server.Storage.Components;
|
||||
using Content.Server.Storage.EntitySystems;
|
||||
using Content.Shared._CP14.Cargo;
|
||||
using Content.Shared._CP14.Cargo.Prototype;
|
||||
using Content.Shared._CP14.Currency;
|
||||
using Content.Shared.Paper;
|
||||
using Content.Shared.Throwing;
|
||||
using Robust.Server.GameObjects;
|
||||
@@ -105,7 +106,7 @@ public sealed partial class CP14CargoSystem : CP14SharedCargoSystem
|
||||
}
|
||||
}
|
||||
|
||||
private void AddRandomBuySpecialPosition(Entity<CP14TradingPortalComponent> portal, int count)
|
||||
public void AddRandomBuySpecialPosition(Entity<CP14TradingPortalComponent> portal, int count)
|
||||
{
|
||||
if (_buyProto is null)
|
||||
return;
|
||||
@@ -137,7 +138,7 @@ public sealed partial class CP14CargoSystem : CP14SharedCargoSystem
|
||||
}
|
||||
}
|
||||
|
||||
private void AddRandomSellSpecialPosition(Entity<CP14TradingPortalComponent> portal, int count)
|
||||
public void AddRandomSellSpecialPosition(Entity<CP14TradingPortalComponent> portal, int count)
|
||||
{
|
||||
if (_sellProto is null)
|
||||
return;
|
||||
@@ -215,10 +216,9 @@ public sealed partial class CP14CargoSystem : CP14SharedCargoSystem
|
||||
var cash = 0;
|
||||
foreach (var stored in storage.Contents.ContainedEntities)
|
||||
{
|
||||
var price = _currency.GetTotalCurrency(stored);
|
||||
if (price > 0)
|
||||
if (TryComp<CP14CurrencyComponent>(stored, out var currency))
|
||||
{
|
||||
cash += price;
|
||||
cash += currency.Currency;
|
||||
QueueDel(stored);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user