Cannot stack binary and trinary Atmos pumps and devices. 5x Filter rate boost (#16331)
* Cannot stack binary and trinary Atmos pumps and devices - Filters now have a 5x max volume to compensate for no more stacking - Add flipped versions of mixers and filters to the list of constructables * Oi! No anchoring unstackables together! * Use EntityLookupSystem in Unstackable and Window lookup - Use static method for AnyUnstackableTiles
This commit is contained in:
@@ -1,13 +1,16 @@
|
||||
using Content.Server.Administration.Logs;
|
||||
using Content.Server.Construction.Components;
|
||||
using Content.Server.Coordinates.Helpers;
|
||||
using Content.Server.Popups;
|
||||
using Content.Server.Pulling;
|
||||
using Content.Shared.Construction.Components;
|
||||
using Content.Shared.Construction.Conditions;
|
||||
using Content.Shared.Construction.EntitySystems;
|
||||
using Content.Shared.Database;
|
||||
using Content.Shared.DoAfter;
|
||||
using Content.Shared.Examine;
|
||||
using Content.Shared.Pulling.Components;
|
||||
using Content.Shared.Tag;
|
||||
using Content.Shared.Tools;
|
||||
using Content.Shared.Tools.Components;
|
||||
using Robust.Shared.Map;
|
||||
@@ -24,6 +27,7 @@ namespace Content.Server.Construction
|
||||
[Dependency] private readonly SharedToolSystem _tool = default!;
|
||||
[Dependency] private readonly PullingSystem _pulling = default!;
|
||||
[Dependency] private readonly SharedTransformSystem _transform = default!;
|
||||
[Dependency] private readonly TagSystem _tagSystem = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -85,7 +89,26 @@ namespace Content.Server.Construction
|
||||
// TODO: Anchoring snaps rn anyway!
|
||||
if (component.Snap)
|
||||
{
|
||||
_transform.SetCoordinates(uid, xform.Coordinates.SnapToGrid(EntityManager, _mapManager));
|
||||
var coordinates = xform.Coordinates.SnapToGrid(EntityManager, _mapManager);
|
||||
|
||||
if (_tagSystem.HasTag(uid, "Unstackable"))
|
||||
{
|
||||
// Need to enforce the unstackable rules on anchoring also.
|
||||
var condition = new NoUnstackableInTile();
|
||||
if (NoUnstackableInTile.AnyUnstackableTiles(coordinates, _tagSystem))
|
||||
{
|
||||
var message = condition.GenerateGuideEntry()?.Localization;
|
||||
if (message != null)
|
||||
{
|
||||
// Show the reason to the user:
|
||||
_popup.PopupEntity(Loc.GetString(message), uid, args.User);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
_transform.SetCoordinates(uid, coordinates);
|
||||
}
|
||||
|
||||
RaiseLocalEvent(uid, new BeforeAnchoredEvent(args.User, used));
|
||||
|
||||
Reference in New Issue
Block a user