Skip to content

Commit

Permalink
Update Submodule to 217.2.1 (#534)
Browse files Browse the repository at this point in the history
Ready to Merge Now
(I had to go to 217.2.1 because the prior versions of 217.0.0 weren't
viable)

Includes the following Cherry-Picks:
space-wizards/space-station-14#26387
space-wizards/space-station-14#25963

---------

Co-authored-by: metalgearsloth <[email protected]>
  • Loading branch information
VMSolidus and metalgearsloth authored Jul 12, 2024
1 parent 5460b76 commit 4634419
Show file tree
Hide file tree
Showing 11 changed files with 55 additions and 71 deletions.
1 change: 0 additions & 1 deletion Content.Client/Audio/AmbientSoundSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ protected override void QueueUpdate(EntityUid uid, AmbientSoundComponent ambienc
private static AudioParams _params = AudioParams.Default
.WithVariation(0.01f)
.WithLoop(true)
.WithAttenuation(Attenuation.LinearDistance)
.WithMaxDistance(7f);

/// <summary>
Expand Down
4 changes: 2 additions & 2 deletions Content.Client/Audio/ContentAudioSystem.LobbyMusic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ public sealed partial class ContentAudioSystem
[Dependency] private readonly IStateManager _stateManager = default!;
[Dependency] private readonly IResourceCache _resourceCache = default!;

private readonly AudioParams _lobbySoundtrackParams = new(-5f, 1, "Master", 0, 0, 0, false, 0f);
private readonly AudioParams _roundEndSoundEffectParams = new(-5f, 1, "Master", 0, 0, 0, false, 0f);
private readonly AudioParams _lobbySoundtrackParams = new(-5f, 1, 0, 0, 0, false, 0f);
private readonly AudioParams _roundEndSoundEffectParams = new(-5f, 1, 0, 0, 0, false, 0f);

/// <summary>
/// EntityUid of lobby restart sound component.
Expand Down
23 changes: 10 additions & 13 deletions Content.IntegrationTests/Tests/Buckle/BuckleTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,8 @@ await server.WaitAssertion(() =>
#pragma warning restore NUnit2045
// Move away from the chair
var xformQuery = entityManager.GetEntityQuery<TransformComponent>();
var oldWorldPosition = xformSystem.GetWorldPosition(chair, xformQuery);
xformSystem.SetWorldPosition(human, oldWorldPosition + new Vector2(1000, 1000), xformQuery);
var oldWorldPosition = xformSystem.GetWorldPosition(chair);
xformSystem.SetWorldPosition(human, oldWorldPosition + new Vector2(1000, 1000));
// Out of range
#pragma warning disable NUnit2045 // Interdependent asserts.
Expand All @@ -193,8 +192,8 @@ await server.WaitAssertion(() =>
#pragma warning restore NUnit2045
// Move near the chair
oldWorldPosition = xformSystem.GetWorldPosition(chair, xformQuery);
xformSystem.SetWorldPosition(human, oldWorldPosition + new Vector2(0.5f, 0), xformQuery);
oldWorldPosition = xformSystem.GetWorldPosition(chair);
xformSystem.SetWorldPosition(human, oldWorldPosition + new Vector2(0.5f, 0));
// In range
#pragma warning disable NUnit2045 // Interdependent asserts.
Expand All @@ -220,8 +219,8 @@ await server.WaitAssertion(() =>
Assert.That(buckleSystem.TryBuckle(human, human, chair, buckleComp: buckle));
// Move away from the chair
oldWorldPosition = xformSystem.GetWorldPosition(chair, xformQuery);
xformSystem.SetWorldPosition(human, oldWorldPosition + new Vector2(1, 0), xformQuery);
oldWorldPosition = xformSystem.GetWorldPosition(chair);
xformSystem.SetWorldPosition(human, oldWorldPosition + new Vector2(1, 0));
});

await server.WaitRunTicks(1);
Expand Down Expand Up @@ -371,9 +370,8 @@ await server.WaitAssertion(() =>
});
// Move the buckled entity away
var xformQuery = entityManager.GetEntityQuery<TransformComponent>();
var oldWorldPosition = xformSystem.GetWorldPosition(chair, xformQuery);
xformSystem.SetWorldPosition(human, oldWorldPosition + new Vector2(100, 0), xformQuery);
var oldWorldPosition = xformSystem.GetWorldPosition(chair);
xformSystem.SetWorldPosition(human, oldWorldPosition + new Vector2(100, 0));
});

await PoolManager.WaitUntil(server, () => !buckle.Buckled, 10);
Expand All @@ -383,9 +381,8 @@ await server.WaitAssertion(() =>
await server.WaitAssertion(() =>
{
// Move the now unbuckled entity back onto the chair
var xformQuery = entityManager.GetEntityQuery<TransformComponent>();
var oldWorldPosition = xformSystem.GetWorldPosition(chair, xformQuery);
xformSystem.SetWorldPosition(human, oldWorldPosition, xformQuery);
var oldWorldPosition = xformSystem.GetWorldPosition(chair);
xformSystem.SetWorldPosition(human, oldWorldPosition);
// Buckle
Assert.That(buckleSystem.TryBuckle(human, human, chair, buckleComp: buckle));
Expand Down
19 changes: 10 additions & 9 deletions Content.IntegrationTests/Tests/Disposal/DisposalUnitTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -163,16 +163,14 @@ public async Task Test()
var entityManager = server.ResolveDependency<IEntityManager>();
var xformSystem = entityManager.System<SharedTransformSystem>();
var disposalSystem = entityManager.System<DisposalUnitSystem>();

await server.WaitAssertion(() =>
{
// Spawn the entities
var coordinates = testMap.GridCoords;
human = entityManager.SpawnEntity("HumanDisposalDummy", coordinates);
wrench = entityManager.SpawnEntity("WrenchDummy", coordinates);
disposalUnit = entityManager.SpawnEntity("DisposalUnitDummy", coordinates);
disposalTrunk = entityManager.SpawnEntity("DisposalTrunkDummy",
entityManager.GetComponent<TransformComponent>(disposalUnit).MapPosition);
disposalTrunk = entityManager.SpawnEntity("DisposalTrunkDummy", coordinates);
// Test for components existing
unitUid = disposalUnit;
Expand Down Expand Up @@ -204,21 +202,23 @@ await server.WaitAssertion(() =>

await server.WaitAssertion(() =>
{
// Move the disposal trunk away
var xform = entityManager.GetComponent<TransformComponent>(disposalTrunk);
var worldPos = xformSystem.GetWorldPosition(disposalTrunk);
xformSystem.SetWorldPosition(xform, worldPos + new Vector2(1, 0));
// Move the disposal trunk away
xformSystem.SetWorldPosition(disposalTrunk, worldPos + new Vector2(1, 0));
// Fail to flush with a mob and an item
Flush(disposalUnit, unitComponent, false, disposalSystem, human, wrench);
});

await server.WaitAssertion(() =>
{
// Move the disposal trunk back
var xform = entityManager.GetComponent<TransformComponent>(disposalTrunk);
var worldPos = xformSystem.GetWorldPosition(disposalTrunk);
xformSystem.SetWorldPosition(xform, worldPos - new Vector2(1, 0));
var worldPos = xformSystem.GetWorldPosition(disposalUnit);
// Move the disposal trunk back
xformSystem.SetWorldPosition(disposalTrunk, worldPos);
xformSystem.AnchorEntity((disposalTrunk, xform));
// Fail to flush with a mob and an item, no power
Flush(disposalUnit, unitComponent, false, disposalSystem, human, wrench);
Expand All @@ -240,6 +240,7 @@ await server.WaitAssertion(() =>
// Re-pressurizing
Flush(disposalUnit, unitComponent, false, disposalSystem);
});

await pair.CleanReturnAsync();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,15 @@ await server.WaitAssertion(() =>
var cuffableSys = entityManager.System<CuffableSystem>();
var xformSys = entityManager.System<SharedTransformSystem>();
var xformQuery = entityManager.GetEntityQuery<TransformComponent>();
// Spawn the entities
human = entityManager.SpawnEntity("HumanHandcuffDummy", coordinates);
otherHuman = entityManager.SpawnEntity("HumanHandcuffDummy", coordinates);
cuffs = entityManager.SpawnEntity("HandcuffsDummy", coordinates);
secondCuffs = entityManager.SpawnEntity("HandcuffsDummy", coordinates);
var coords = xformSys.GetWorldPosition(otherHuman, xformQuery);
xformSys.SetWorldPosition(human, coords, xformQuery);
var coords = xformSys.GetWorldPosition(otherHuman);
xformSys.SetWorldPosition(human, coords);
// Test for components existing
Assert.Multiple(() =>
Expand Down
12 changes: 6 additions & 6 deletions Content.Server/Anomaly/Effects/BluespaceAnomalySystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using Content.Shared.Teleportation.Components;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Collections;
using Robust.Shared.Random;

namespace Content.Server.Anomaly.Effects;
Expand Down Expand Up @@ -35,20 +36,19 @@ private void OnPulse(EntityUid uid, BluespaceAnomalyComponent component, ref Ano
var range = component.MaxShuffleRadius * args.Severity;
var mobs = new HashSet<Entity<MobStateComponent>>();
_lookup.GetEntitiesInRange(xform.Coordinates, range, mobs);
var allEnts = new List<EntityUid>(mobs.Select(m => m.Owner)) { uid };
var coords = new List<Vector2>();
var allEnts = new ValueList<EntityUid>(mobs.Select(m => m.Owner)) { uid };
var coords = new ValueList<Vector2>();
foreach (var ent in allEnts)
{
if (xformQuery.TryGetComponent(ent, out var xf))
coords.Add(xf.MapPosition.Position);
if (xformQuery.TryGetComponent(ent, out var allXform))
coords.Add(_xform.GetWorldPosition(allXform));
}

_random.Shuffle(coords);
for (var i = 0; i < allEnts.Count; i++)
{

_adminLogger.Add(LogType.Teleport, $"{ToPrettyString(allEnts[i])} has been shuffled to {coords[i]} by the {ToPrettyString(uid)} at {xform.Coordinates}");
_xform.SetWorldPosition(allEnts[i], coords[i], xformQuery);
_xform.SetWorldPosition(allEnts[i], coords[i]);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public sealed partial class DeepFryerSystem : SharedDeepfryerSystem
private static readonly string MobFlavorMeat = "meaty";

private static readonly AudioParams
AudioParamsInsertRemove = new(0.5f, 1f, "Master", 5f, 1.5f, 1f, false, 0f, 0.2f);
AudioParamsInsertRemove = new(0.5f, 1f, 5f, 1.5f, 1f, false, 0f, 0.2f);

private ISawmill _sawmill = default!;

Expand Down
3 changes: 0 additions & 3 deletions Content.Shared/Disposal/SharedDisposalUnitSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,6 @@ public virtual bool CanInsert(EntityUid uid, SharedDisposalUnitComponent compone
return damageState != null && (!component.MobsCanEnter || _mobState.IsDead(entity, damageState));
}

/// <summary>
/// TODO: Proper prediction
/// </summary>
public abstract void DoInsertDisposalUnit(EntityUid uid, EntityUid toInsert, EntityUid user, SharedDisposalUnitComponent? disposal = null);

[Serializable, NetSerializable]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace Content.Shared.Light.Components;
[NetworkedComponent]
public abstract partial class SharedExpendableLightComponent : Component
{
public static readonly AudioParams LoopedSoundParams = new(0, 1, "Master", 62.5f, 1, 1, true, 0.3f);
public static readonly AudioParams LoopedSoundParams = new(0, 1, 62.5f, 1, 1, true, 0.3f);

[ViewVariables(VVAccess.ReadOnly)]
public ExpendableLightState CurrentState { get; set; }
Expand Down
53 changes: 22 additions & 31 deletions Content.Shared/Storage/EntitySystems/DumpableSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,16 @@ public sealed class DumpableSystem : EntitySystem
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
[Dependency] private readonly IRobustRandom _random = default!;
[Dependency] private readonly SharedAudioSystem _audio = default!;
[Dependency] private readonly SharedContainerSystem _container = default!;
[Dependency] private readonly SharedDisposalUnitSystem _disposalUnitSystem = default!;
[Dependency] private readonly SharedDoAfterSystem _doAfterSystem = default!;
[Dependency] private readonly SharedTransformSystem _transformSystem = default!;

private EntityQuery<TransformComponent> _xformQuery;
private EntityQuery<ItemComponent> _itemQuery;

public override void Initialize()
{
base.Initialize();
_xformQuery = GetEntityQuery<TransformComponent>();
_itemQuery = GetEntityQuery<ItemComponent>();
SubscribeLocalEvent<DumpableComponent, AfterInteractEvent>(OnAfterInteract, after: new[]{ typeof(SharedEntityStorageSystem) });
SubscribeLocalEvent<DumpableComponent, GetVerbsEvent<AlternativeVerb>>(AddDumpVerb);
SubscribeLocalEvent<DumpableComponent, GetVerbsEvent<UtilityVerb>>(AddUtilityVerbs);
Expand Down Expand Up @@ -111,7 +110,7 @@ private void AddUtilityVerbs(EntityUid uid, DumpableComponent dumpable, GetVerbs
}
}

private void StartDoAfter(EntityUid storageUid, EntityUid? targetUid, EntityUid userUid, DumpableComponent dumpable)
private void StartDoAfter(EntityUid storageUid, EntityUid targetUid, EntityUid userUid, DumpableComponent dumpable)
{
if (!TryComp<StorageComponent>(storageUid, out var storage))
return;
Expand All @@ -120,7 +119,7 @@ private void StartDoAfter(EntityUid storageUid, EntityUid? targetUid, EntityUid

foreach (var entity in storage.Container.ContainedEntities)
{
if (!TryComp<ItemComponent>(entity, out var itemComp) ||
if (!_itemQuery.TryGetComponent(entity, out var itemComp) ||
!_prototypeManager.TryIndex(itemComp.Size, out var itemSize))
{
continue;
Expand All @@ -139,33 +138,16 @@ private void StartDoAfter(EntityUid storageUid, EntityUid? targetUid, EntityUid
});
}

private void OnDoAfter(EntityUid uid, DumpableComponent component, DoAfterEvent args)
private void OnDoAfter(EntityUid uid, DumpableComponent component, DumpableDoAfterEvent args)
{
if (args.Handled || args.Cancelled || !TryComp<StorageComponent>(uid, out var storage))
if (args.Handled || args.Cancelled || !TryComp<StorageComponent>(uid, out var storage) || storage.Container.ContainedEntities.Count == 0)
return;

Queue<EntityUid> dumpQueue = new();
foreach (var entity in storage.Container.ContainedEntities)
{
dumpQueue.Enqueue(entity);
}

if (dumpQueue.Count == 0)
return;

foreach (var entity in dumpQueue)
{
var transform = Transform(entity);
_container.AttachParentToContainerOrGrid((entity, transform));
_transformSystem.SetLocalPositionRotation(entity, transform.LocalPosition + _random.NextVector2Box() / 2, _random.NextAngle(), transform);
}

if (args.Args.Target == null)
return;
var dumpQueue = new Queue<EntityUid>(storage.Container.ContainedEntities);

var dumped = false;

if (_disposalUnitSystem.HasDisposals(args.Args.Target.Value))
if (_disposalUnitSystem.HasDisposals(args.Args.Target))
{
dumped = true;

Expand All @@ -174,22 +156,31 @@ private void OnDoAfter(EntityUid uid, DumpableComponent component, DoAfterEvent
_disposalUnitSystem.DoInsertDisposalUnit(args.Args.Target.Value, entity, args.Args.User);
}
}
else if (HasComp<PlaceableSurfaceComponent>(args.Args.Target.Value))
else if (HasComp<PlaceableSurfaceComponent>(args.Args.Target))
{
dumped = true;

var targetPos = _xformQuery.GetComponent(args.Args.Target.Value).LocalPosition;
var targetPos = _transformSystem.GetWorldPosition(args.Args.Target.Value);

foreach (var entity in dumpQueue)
{
_transformSystem.SetWorldPosition(entity, targetPos + _random.NextVector2Box() / 4);
}
}
else
{
var targetPos = _transformSystem.GetWorldPosition(uid);

foreach (var entity in dumpQueue)
{
_transformSystem.SetLocalPosition(entity, targetPos + _random.NextVector2Box() / 4);
var transform = Transform(entity);
_transformSystem.SetWorldPositionRotation(entity, targetPos + _random.NextVector2Box() / 4, _random.NextAngle(), transform);
}
}

if (dumped)
{
// TODO: Predicted when above predicted
_audio.PlayPvs(component.DumpSound, uid);
_audio.PlayPredicted(component.DumpSound, uid, args.User);
}
}
}
2 changes: 1 addition & 1 deletion RobustToolbox
Submodule RobustToolbox updated 36 files
+1 −1 MSBuild/Robust.Engine.Version.props
+57 −1 RELEASE-NOTES.md
+15 −0 Resources/Locale/en-US/view-variables.ftl
+0 −3 Resources/Locale/en-US/vv.ftl
+83 −0 Robust.Benchmarks/Collections/ValueListEnumerationBenchmarks.cs
+3 −3 Robust.Client/GameObjects/EntitySystems/ContainerSystem.cs
+4 −1 Robust.Client/Graphics/Clyde/Clyde.HLR.cs
+1 −1 Robust.Client/UserInterface/Control.Animations.cs
+25 −0 Robust.Client/UserInterface/Controls/LineEdit.cs
+2 −2 Robust.Client/UserInterface/Controls/ScrollContainer.cs
+286 −3 Robust.Client/ViewVariables/Editors/VVPropEditorSoundSpecifier.cs
+9 −41 Robust.Shared/Audio/AudioParams.cs
+16 −0 Robust.Shared/CVars.cs
+1 −1 Robust.Shared/GameObjects/EntityEventBus.Broadcast.cs
+2 −2 Robust.Shared/GameObjects/EntityEventBus.Ordering.cs
+55 −0 Robust.Shared/GameObjects/EntityManager.Components.cs
+21 −0 Robust.Shared/GameObjects/IEntityManager.Components.cs
+1 −1 Robust.Shared/GameObjects/Systems/EntityLookup.Queries.cs
+1 −1 Robust.Shared/GameObjects/Systems/EntityLookupSystem.ComponentQueries.cs
+2 −2 Robust.Shared/GameObjects/Systems/SharedGridFixtureSystem.cs
+21 −28 Robust.Shared/GameObjects/Systems/SharedTransformSystem.Component.cs
+14 −2 Robust.Shared/GameObjects/Systems/SharedUserInterfaceSystem.cs
+2 −2 Robust.Shared/Physics/Systems/FixtureSystem.cs
+1 −1 Robust.Shared/Physics/Systems/SharedPhysicsSystem.Components.cs
+3 −2 Robust.Shared/Physics/Systems/SharedPhysicsSystem.Queries.cs
+12 −0 Robust.Shared/Physics/Systems/SharedPhysicsSystem.cs
+1 −1 Robust.Shared/Prototypes/PrototypeManager.YamlLoad.cs
+1 −1 Robust.Shared/Prototypes/PrototypeManager.cs
+105 −36 Robust.Shared/Random/IRobustRandom.cs
+214 −111 Robust.Shared/Random/RandomExtensions.cs
+59 −52 Robust.Shared/Random/RobustRandom.cs
+3 −18 Robust.UnitTesting/Client/UserInterface/Controls/LineEditTest.cs
+60 −0 Robust.UnitTesting/Server/GameObjects/Components/TransformIntegration_Test.cs
+63 −2 Robust.UnitTesting/Shared/GameObjects/EntityManager_Components_Tests.cs
+0 −1 Robust.UnitTesting/Shared/Map/GridSplit_Tests.cs
+284 −0 Robust.UnitTesting/Shared/Random/RandomExtensionsTests.cs

0 comments on commit 4634419

Please sign in to comment.