Mini fix pack (#1440)
* Update CP14PriceScannerSystem.cs * Update CP14PriceScannerSystem.cs * fix #1435 * fix #1393
This commit is contained in:
@@ -1,12 +1,10 @@
|
||||
using System.Text;
|
||||
using Content.Server.Cargo.Systems;
|
||||
using Content.Shared._CP14.Currency;
|
||||
using Content.Shared.Examine;
|
||||
using Content.Shared.Interaction;
|
||||
using Content.Shared.Inventory;
|
||||
using Content.Shared.Tag;
|
||||
using Content.Shared._CP14.Trading.Components;
|
||||
|
||||
using Content.Shared.Mobs.Components;
|
||||
|
||||
namespace Content.Server._CP14.Trading;
|
||||
|
||||
@@ -17,7 +15,6 @@ public sealed class CP14PriceScannerSystem : EntitySystem
|
||||
[Dependency] private readonly InventorySystem _invSystem = default!;
|
||||
[Dependency] private readonly CP14SharedCurrencySystem _currency = default!;
|
||||
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
SubscribeLocalEvent<MetaDataComponent, ExaminedEvent>(OnExamined);
|
||||
@@ -25,29 +22,22 @@ public sealed class CP14PriceScannerSystem : EntitySystem
|
||||
|
||||
private bool IsAbleExamine(EntityUid uid)
|
||||
{
|
||||
if (_invSystem.TryGetSlotEntity(uid, "eyes", out var huds)
|
||||
&& HasComp<CP14PriceScannerComponent>(huds))
|
||||
{
|
||||
if (HasComp<CP14PriceScannerComponent>(uid))
|
||||
return true;
|
||||
}
|
||||
else if (HasComp<CP14PriceScannerComponent>(uid))
|
||||
{
|
||||
if (_invSystem.TryGetSlotEntity(uid, "eyes", out var huds) && HasComp<CP14PriceScannerComponent>(huds))
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private void OnExamined(EntityUid eid, MetaDataComponent component, ExaminedEvent args)
|
||||
private void OnExamined(EntityUid uid, MetaDataComponent component, ExaminedEvent args)
|
||||
{
|
||||
if (!IsAbleExamine(args.Examiner))
|
||||
{
|
||||
return;
|
||||
}
|
||||
else if (_tag.HasTag(args.Examined, "CP14Coin"))
|
||||
{
|
||||
if (_tag.HasTag(args.Examined, "CP14Coin"))
|
||||
return;
|
||||
if (HasComp<MobStateComponent>(uid))
|
||||
return;
|
||||
}
|
||||
|
||||
var getPrice = _price.GetPrice(args.Examined);
|
||||
|
||||
@@ -59,5 +49,4 @@ public sealed class CP14PriceScannerSystem : EntitySystem
|
||||
|
||||
args.PushMarkup(priceMsg);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using Content.Shared.Chemistry.EntitySystems;
|
||||
using Content.Shared.Chemistry.Reagent;
|
||||
using Content.Shared.Nutrition.Components;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Random;
|
||||
|
||||
@@ -18,6 +19,9 @@ public sealed partial class RefillSolutions : CP14WeatherEffect
|
||||
if (!entManager.TryGetComponent<CP14WeatherRefillableComponent>(target, out var refillable))
|
||||
return;
|
||||
|
||||
if (entManager.TryGetComponent<OpenableComponent>(target, out var openable) && !openable.Opened)
|
||||
return;
|
||||
|
||||
var solutionSystem = entManager.System<SharedSolutionContainerSystem>();
|
||||
|
||||
solutionSystem.TryGetSolution(target, refillable.Solution, out var ent, out var solution);
|
||||
|
||||
@@ -100,6 +100,7 @@
|
||||
normalState: burning
|
||||
- type: Climbable
|
||||
- type: Anchorable
|
||||
- type: Rotatable
|
||||
- type: Fixtures
|
||||
fixtures:
|
||||
fix1:
|
||||
|
||||
Reference in New Issue
Block a user