From 12503e57a55e74b2f296d6fad62d3c451bbecddb Mon Sep 17 00:00:00 2001 From: Leon Friedrich <60421075+ElectroJr@users.noreply.github.com> Date: Mon, 31 Oct 2022 15:26:05 +1300 Subject: [PATCH] Fix construction/crafting and maybe cargo selling (#12306) --- Content.Server/Cargo/Systems/CargoSystem.Shuttle.cs | 8 +++++--- Content.Server/Construction/ConstructionSystem.Initial.cs | 6 ++++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Content.Server/Cargo/Systems/CargoSystem.Shuttle.cs b/Content.Server/Cargo/Systems/CargoSystem.Shuttle.cs index f5c2e85cdb..00e0bb8f81 100644 --- a/Content.Server/Cargo/Systems/CargoSystem.Shuttle.cs +++ b/Content.Server/Cargo/Systems/CargoSystem.Shuttle.cs @@ -316,10 +316,12 @@ public sealed partial class CargoSystem foreach (var pallet in GetCargoPallets(component)) { // Containers should already get the sell price of their children so can skip those. - foreach (var ent in _lookup.GetEntitiesIntersecting(pallet.Owner, LookupFlags.Anchored | LookupFlags.Approximate)) + foreach (var ent in _lookup.GetEntitiesIntersecting(pallet.Owner, LookupFlags.Dynamic | LookupFlags.Sundries | LookupFlags.Approximate)) { - // Don't re-sell anything, sell anything anchored (e.g. light fixtures), or anything blacklisted - // (e.g. players). + // Dont sell: + // - anything already being sold + // - anything anchored (e.g. light fixtures) + // - anything blacklisted (e.g. players). if (toSell.Contains(ent) || (xformQuery.TryGetComponent(ent, out var xform) && xform.Anchored)) continue; diff --git a/Content.Server/Construction/ConstructionSystem.Initial.cs b/Content.Server/Construction/ConstructionSystem.Initial.cs index c72140ba94..0b2d200c87 100644 --- a/Content.Server/Construction/ConstructionSystem.Initial.cs +++ b/Content.Server/Construction/ConstructionSystem.Initial.cs @@ -79,8 +79,10 @@ namespace Content.Server.Construction var pos = Transform(user).MapPosition; - foreach (var near in _lookupSystem.GetEntitiesInRange(user, 2f, LookupFlags.Approximate)) + foreach (var near in _lookupSystem.GetEntitiesInRange(pos, 2f, LookupFlags.Contained | LookupFlags.Dynamic | LookupFlags.Sundries | LookupFlags.Approximate)) { + if (near == user) + continue; if (_interactionSystem.InRangeUnobstructed(pos, near, 2f) && _container.IsInSameOrParentContainer(user, near)) yield return near; } @@ -306,7 +308,7 @@ namespace Content.Server.Construction var targetNode = constructionGraph.Nodes[constructionPrototype.TargetNode]; var pathFind = constructionGraph.Path(startNode.Name, targetNode.Name); - if (args.SenderSession.AttachedEntity is not {Valid: true} user || _actionBlocker.CanInteract(user, null)) + if (args.SenderSession.AttachedEntity is not {Valid: true} user || !_actionBlocker.CanInteract(user, null)) return; if (!HasComp(user))