Improve stack merging and crafting (#7105)
This commit is contained in:
@@ -14,6 +14,7 @@ using Content.Shared.Hands.EntitySystems;
|
||||
using Content.Shared.Interaction;
|
||||
using Content.Shared.Inventory;
|
||||
using Content.Shared.Popups;
|
||||
using Content.Shared.Stacks;
|
||||
using Robust.Shared.Containers;
|
||||
using Robust.Shared.Players;
|
||||
using Robust.Shared.Timing;
|
||||
@@ -336,8 +337,12 @@ namespace Content.Server.Construction
|
||||
}
|
||||
}
|
||||
|
||||
if (await Construct(user, "item_construction", constructionGraph, edge, targetNode) is {Valid: true} item)
|
||||
_handsSystem.PickupOrDrop(user, item);
|
||||
if (await Construct(user, "item_construction", constructionGraph, edge, targetNode) is not { Valid: true } item)
|
||||
return;
|
||||
|
||||
// Just in case this is a stack, attempt to merge it. If it isn't a stack, this will just normally pick up
|
||||
// or drop the item as normal.
|
||||
_stackSystem.TryMergeToHands(item, user);
|
||||
}
|
||||
|
||||
// LEGACY CODE. See warning at the top of the file!
|
||||
|
||||
Reference in New Issue
Block a user