Throw out throw helpers (#7195)

This commit is contained in:
Leon Friedrich
2022-03-24 02:33:01 +13:00
committed by GitHub
parent 74d4adfb96
commit de190e4e2f
8 changed files with 127 additions and 125 deletions

View File

@@ -9,9 +9,9 @@ using Content.Shared.VendingMachines;
using Robust.Server.GameObjects;
using Robust.Shared.Prototypes;
using Robust.Shared.Random;
using Content.Server.Throwing;
using Content.Shared.Acts;
using static Content.Shared.VendingMachines.SharedVendingMachineComponent;
using Content.Shared.Throwing;
namespace Content.Server.VendingMachines.systems
{
@@ -20,7 +20,8 @@ namespace Content.Server.VendingMachines.systems
[Dependency] private readonly IRobustRandom _random = default!;
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
[Dependency] private readonly AccessReaderSystem _accessReader = default!;
[Dependency] private readonly PopupSystem _popupSystem = default!;
[Dependency] private readonly PopupSystem _popupSystem = default!;
[Dependency] private readonly ThrowingSystem _throwingSystem = default!;
public override void Initialize()
{
@@ -197,7 +198,7 @@ namespace Content.Server.VendingMachines.systems
{
float range = vendComponent.NonLimitedEjectRange;
Vector2 direction = new Vector2(_random.NextFloat(-range, range), _random.NextFloat(-range, range));
ent.TryThrow(direction, vendComponent.NonLimitedEjectForce);
_throwingSystem.TryThrow(ent, direction, vendComponent.NonLimitedEjectForce);
}
});
SoundSystem.Play(Filter.Pvs(vendComponent.Owner), vendComponent.SoundVend.GetSound(), vendComponent.Owner, AudioParams.Default.WithVolume(-2f));