mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-15 03:30:53 +01:00
ContainerHelpers EmptyContainer now has an argument to attach removed entities to grid or map
This commit is contained in:
@@ -108,7 +108,7 @@ namespace Robust.Shared.Containers
|
||||
/// <summary>
|
||||
/// Attempts to remove all entities in a container.
|
||||
/// </summary>
|
||||
public static void EmptyContainer(this IContainer container, bool force = false, EntityCoordinates? moveTo = null)
|
||||
public static void EmptyContainer(this IContainer container, bool force = false, EntityCoordinates? moveTo = null, bool attachToGridOrMap = false)
|
||||
{
|
||||
foreach (var entity in container.ContainedEntities.ToArray())
|
||||
{
|
||||
@@ -121,6 +121,9 @@ namespace Robust.Shared.Containers
|
||||
|
||||
if (moveTo.HasValue)
|
||||
entity.Transform.Coordinates = moveTo.Value;
|
||||
|
||||
if(attachToGridOrMap)
|
||||
entity.Transform.AttachToGridOrMap();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user