Clean up StoreSystem (#14027)
This commit is contained in:
@@ -24,7 +24,7 @@ namespace Content.Server.Traitor.Uplink
|
||||
public int GetTCBalance(StoreComponent component)
|
||||
{
|
||||
FixedPoint2? tcBalance = component.Balance.GetValueOrDefault(TelecrystalCurrencyPrototype);
|
||||
return tcBalance != null ? tcBalance.Value.Int() : 0;
|
||||
return tcBalance?.Int() ?? 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -46,15 +46,14 @@ namespace Content.Server.Traitor.Uplink
|
||||
}
|
||||
|
||||
var store = EnsureComp<StoreComponent>(uplinkEntity.Value);
|
||||
_store.InitializeFromPreset(uplinkPresetId, store);
|
||||
_store.InitializeFromPreset(uplinkPresetId, uplinkEntity.Value, store);
|
||||
store.AccountOwner = user;
|
||||
store.Balance.Clear();
|
||||
|
||||
if (balance != null)
|
||||
{
|
||||
store.Balance.Clear();
|
||||
_store.TryAddCurrency(
|
||||
new Dictionary<string, FixedPoint2>() { { TelecrystalCurrencyPrototype, balance.Value } }, store);
|
||||
_store.TryAddCurrency(new Dictionary<string, FixedPoint2> { { TelecrystalCurrencyPrototype, balance.Value } }, uplinkEntity.Value, store);
|
||||
}
|
||||
|
||||
// TODO add BUI. Currently can't be done outside of yaml -_-
|
||||
|
||||
Reference in New Issue
Block a user