Trashbag stuff (#18096)

This commit is contained in:
metalgearsloth
2023-07-18 21:44:00 +10:00
committed by GitHub
parent e0291500af
commit fcf01cc6ef
13 changed files with 55 additions and 44 deletions

View File

@@ -6,6 +6,7 @@ namespace Content.Server.Disposal.Unit.Components;
// GasMixture life.
[RegisterComponent]
[ComponentReference(typeof(SharedDisposalUnitComponent))]
public sealed class DisposalUnitComponent : SharedDisposalUnitComponent
{
[DataField("air")]

View File

@@ -94,7 +94,7 @@ namespace Content.Server.Hands.Systems
args.Handled = true; // no shove/stun.
}
public override void PickupAnimation(EntityUid item, EntityCoordinates initialPosition, Vector2 finalPosition,
public override void PickupAnimation(EntityUid item, EntityCoordinates initialPosition, Vector2 finalPosition, Angle initialAngle,
EntityUid? exclude)
{
if (finalPosition.EqualsApprox(initialPosition.Position, tolerance: 0.1f))
@@ -105,7 +105,7 @@ namespace Content.Server.Hands.Systems
if (exclude != null)
filter = filter.RemoveWhereAttachedEntity(entity => entity == exclude);
RaiseNetworkEvent(new PickupAnimationEvent(item, initialPosition, finalPosition), filter);
RaiseNetworkEvent(new PickupAnimationEvent(item, initialPosition, finalPosition, initialAngle), filter);
}
protected override void HandleEntityRemoved(EntityUid uid, HandsComponent hands, EntRemovedFromContainerMessage args)

View File

@@ -275,7 +275,8 @@ namespace Content.Server.Storage.EntitySystems
{
RaiseNetworkEvent(new AnimateInsertingEntitiesEvent(uid,
new List<EntityUid> { target },
new List<EntityCoordinates> { position }));
new List<EntityCoordinates> { position },
new List<Angle> { transformOwner.LocalRotation }));
}
}
}
@@ -288,6 +289,7 @@ namespace Content.Server.Storage.EntitySystems
var successfullyInserted = new List<EntityUid>();
var successfullyInsertedPositions = new List<EntityCoordinates>();
var successfullyInsertedAngles = new List<Angle>();
var itemQuery = GetEntityQuery<ItemComponent>();
var xformQuery = GetEntityQuery<TransformComponent>();
xformQuery.TryGetComponent(uid, out var xform);
@@ -313,10 +315,13 @@ namespace Content.Server.Storage.EntitySystems
_transform
);
var angle = targetXform.LocalRotation;
if (PlayerInsertEntityInWorld(uid, args.Args.User, entity, component))
{
successfullyInserted.Add(entity);
successfullyInsertedPositions.Add(position);
successfullyInsertedAngles.Add(angle);
}
}
@@ -324,7 +329,7 @@ namespace Content.Server.Storage.EntitySystems
if (successfullyInserted.Count > 0)
{
_audio.PlayPvs(component.StorageInsertSound, uid);
RaiseNetworkEvent(new AnimateInsertingEntitiesEvent(uid, successfullyInserted, successfullyInsertedPositions));
RaiseNetworkEvent(new AnimateInsertingEntitiesEvent(uid, successfullyInserted, successfullyInsertedPositions, successfullyInsertedAngles));
}
args.Handled = true;