Cargo price tweaks 2 (#11307)

* Cargo price tweaks 2

* Allow cargo selling dead organics
This commit is contained in:
metalgearsloth
2022-09-16 03:29:07 +10:00
committed by GitHub
parent d8754b2014
commit ed442a7d3b
22 changed files with 63 additions and 45 deletions

View File

@@ -1,6 +1,7 @@
using System.Linq;
using Content.Server.Cargo.Components;
using Content.Server.Labels.Components;
using Content.Server.MobState;
using Content.Server.Shuttles.Components;
using Content.Server.Shuttles.Events;
using Content.Server.UserInterface;
@@ -39,6 +40,7 @@ public sealed partial class CargoSystem
[Dependency] private readonly IMapManager _mapManager = default!;
[Dependency] private readonly IRobustRandom _random = default!;
[Dependency] private readonly EntityLookupSystem _lookup = default!;
[Dependency] private readonly MobStateSystem _mobState = default!;
[Dependency] private readonly PricingSystem _pricing = default!;
[Dependency] private readonly ShuttleConsoleSystem _console = default!;
[Dependency] private readonly ShuttleSystem _shuttle = default!;
@@ -534,8 +536,8 @@ public sealed partial class CargoSystem
while (childEnumerator.MoveNext(out var child))
{
if (mobQuery.HasComponent(child.Value) ||
FoundOrganics(child.Value, mobQuery, xformQuery)) return true;
if ((mobQuery.TryGetComponent(child.Value, out var mobState) && !_mobState.IsDead(child.Value, mobState))
|| FoundOrganics(child.Value, mobQuery, xformQuery)) return true;
}
return false;