Fix even more warnings (#11968)

Also more instances of someone using TryComp instead of HasComp

Co-authored-by: metalgearsloth <metalgearsloth@gmail.com>
This commit is contained in:
metalgearsloth
2022-10-17 02:49:22 +11:00
committed by GitHub
parent 214d0c1774
commit 1782eb6ad7
22 changed files with 86 additions and 58 deletions

View File

@@ -54,7 +54,8 @@ namespace Content.Server.AME.Components
_injecting = false; _injecting = false;
InjectionAmount = 2; InjectionAmount = 2;
JarSlot = ContainerHelpers.EnsureContainer<ContainerSlot>(Owner, $"{Name}-fuelJarContainer"); // TODO: Fix this bad name. I'd update maps but then people get mad.
JarSlot = ContainerHelpers.EnsureContainer<ContainerSlot>(Owner, $"AMEController-fuelJarContainer");
} }
internal void OnUpdate(float frameTime) internal void OnUpdate(float frameTime)

View File

@@ -27,10 +27,10 @@ namespace Content.Server.Access.Systems
private void OnAfterInteract(EntityUid uid, AgentIDCardComponent component, AfterInteractEvent args) private void OnAfterInteract(EntityUid uid, AgentIDCardComponent component, AfterInteractEvent args)
{ {
if (!TryComp<AccessComponent>(args.Target, out var targetAccess) || !TryComp<IdCardComponent>(args.Target, out var targetIDCard) || args.Target == null) if (!TryComp<AccessComponent>(args.Target, out var targetAccess) || !HasComp<IdCardComponent>(args.Target) || args.Target == null)
return; return;
if (!TryComp<AccessComponent>(uid, out var access) || !TryComp<IdCardComponent>(uid, out var idCard)) if (!TryComp<AccessComponent>(uid, out var access) || !HasComp<IdCardComponent>(uid))
return; return;
var beforeLength = access.Tags.Count; var beforeLength = access.Tags.Count;

View File

@@ -11,9 +11,11 @@ namespace Content.Server.Alert.Click
{ {
public void AlertClicked(EntityUid player) public void AlertClicked(EntityUid player)
{ {
if (IoCManager.Resolve<IEntityManager>().TryGetComponent<MimePowersComponent?>(player, out var mimePowers)) var entManager = IoCManager.Resolve<IEntityManager>();
if (entManager.TryGetComponent<MimePowersComponent?>(player, out var mimePowers))
{ {
EntitySystem.Get<MimePowersSystem>().BreakVow(player, mimePowers); entManager.System<MimePowersSystem>().BreakVow(player, mimePowers);
} }
} }
} }

View File

@@ -14,9 +14,11 @@ namespace Content.Server.Alert.Click
{ {
public void AlertClicked(EntityUid player) public void AlertClicked(EntityUid player)
{ {
if (IoCManager.Resolve<IEntityManager>().TryGetComponent(player, out FlammableComponent? flammable)) var entManager = IoCManager.Resolve<IEntityManager>();
if (entManager.TryGetComponent(player, out FlammableComponent? flammable))
{ {
EntitySystem.Get<FlammableSystem>().Resist(player, flammable); entManager.System<FlammableSystem>().Resist(player, flammable);
} }
} }
} }

View File

@@ -11,9 +11,11 @@ namespace Content.Server.Alert.Click
{ {
public void AlertClicked(EntityUid player) public void AlertClicked(EntityUid player)
{ {
if (IoCManager.Resolve<IEntityManager>().TryGetComponent<MimePowersComponent?>(player, out var mimePowers)) var entManager = IoCManager.Resolve<IEntityManager>();
if (entManager.TryGetComponent<MimePowersComponent?>(player, out var mimePowers))
{ {
EntitySystem.Get<MimePowersSystem>().RetakeVow(player, mimePowers); entManager.System<MimePowersSystem>().RetakeVow(player, mimePowers);
} }
} }
} }

View File

@@ -15,12 +15,14 @@ namespace Content.Server.Alert.Click
{ {
public void AlertClicked(EntityUid player) public void AlertClicked(EntityUid player)
{ {
if (!EntitySystem.Get<ActionBlockerSystem>().CanInteract(player, null)) var entityManager = IoCManager.Resolve<IEntityManager>();
if (!entityManager.System<ActionBlockerSystem>().CanInteract(player, null))
return; return;
if (IoCManager.Resolve<IEntityManager>().TryGetComponent<SharedPullableComponent?>(player, out var playerPullable)) if (entityManager.TryGetComponent<SharedPullableComponent?>(player, out var playerPullable))
{ {
EntitySystem.Get<SharedPullingSystem>().TryStopPull(playerPullable); entityManager.System<SharedPullingSystem>().TryStopPull(playerPullable);
} }
} }
} }

View File

@@ -14,10 +14,12 @@ namespace Content.Server.Alert.Click
{ {
public void AlertClicked(EntityUid player) public void AlertClicked(EntityUid player)
{ {
if (IoCManager.Resolve<IEntityManager>().TryGetComponent(player, out PilotComponent? pilotComponent) && var entManager = IoCManager.Resolve<IEntityManager>();
if (entManager.TryGetComponent(player, out PilotComponent? pilotComponent) &&
pilotComponent.Console != null) pilotComponent.Console != null)
{ {
EntitySystem.Get<ShuttleConsoleSystem>().RemovePilot(pilotComponent); entManager.System<ShuttleConsoleSystem>().RemovePilot(pilotComponent);
} }
} }
} }

View File

@@ -14,9 +14,11 @@ namespace Content.Server.Alert.Click
{ {
public void AlertClicked(EntityUid player) public void AlertClicked(EntityUid player)
{ {
var ps = EntitySystem.Get<SharedPullingSystem>(); var entManager = IoCManager.Resolve<IEntityManager>();
var ps = entManager.System<SharedPullingSystem>();
var playerTarget = ps.GetPulled(player); var playerTarget = ps.GetPulled(player);
if (playerTarget != default && IoCManager.Resolve<IEntityManager>().TryGetComponent(playerTarget, out SharedPullableComponent? playerPullable)) if (playerTarget != default && entManager.TryGetComponent(playerTarget, out SharedPullableComponent? playerPullable))
{ {
ps.TryStopPull(playerPullable); ps.TryStopPull(playerPullable);
} }

View File

@@ -2,16 +2,17 @@ using Robust.Shared.Serialization;
namespace Content.Shared.Access.Systems namespace Content.Shared.Access.Systems
{ {
public class SharedAgentIdCardSystem : EntitySystem public abstract class SharedAgentIdCardSystem : EntitySystem
{ {
/// Just for friending for now // Just for friending for now
} }
/// <summary> /// <summary>
/// Key representing which <see cref="BoundUserInterface"/> is currently open. /// Key representing which <see cref="BoundUserInterface"/> is currently open.
/// Useful when there are multiple UI for an object. Here it's future-proofing only. /// Useful when there are multiple UI for an object. Here it's future-proofing only.
/// </summary> /// </summary>
[Serializable, NetSerializable] [Serializable, NetSerializable]
public enum AgentIDCardUiKey public enum AgentIDCardUiKey : byte
{ {
Key, Key,
} }

View File

@@ -6,10 +6,7 @@ namespace Content.Shared.Alert;
public abstract class AlertsSystem : EntitySystem public abstract class AlertsSystem : EntitySystem
{ {
[Dependency] [Dependency] private readonly IPrototypeManager _prototypeManager = default!;
private readonly IPrototypeManager _prototypeManager = default!;
[Dependency] private readonly MetaDataSystem _metaSystem = default!;
private readonly Dictionary<AlertType, AlertPrototype> _typeToAlert = new(); private readonly Dictionary<AlertType, AlertPrototype> _typeToAlert = new();

View File

@@ -14,6 +14,8 @@ public abstract class SharedHandheldLightSystem : EntitySystem
[Dependency] private readonly SharedItemSystem _itemSys = default!; [Dependency] private readonly SharedItemSystem _itemSys = default!;
[Dependency] private readonly ClothingSystem _clothingSys = default!; [Dependency] private readonly ClothingSystem _clothingSys = default!;
[Dependency] private readonly SharedActionsSystem _actionSystem = default!; [Dependency] private readonly SharedActionsSystem _actionSystem = default!;
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
[Dependency] private readonly SharedAudioSystem _audio = default!;
public override void Initialize() public override void Initialize()
{ {
@@ -52,9 +54,9 @@ public abstract class SharedHandheldLightSystem : EntitySystem
if (makeNoise) if (makeNoise)
{ {
var sound = component.Activated ? component.TurnOnSound : component.TurnOffSound; var sound = component.Activated ? component.TurnOnSound : component.TurnOffSound;
SoundSystem.Play(sound.GetSound(), Filter.Pvs(component.Owner, entityManager: EntityManager), component.Owner); _audio.PlayPvs(sound, component.Owner);
} }
Dirty(component); Dirty(component);
UpdateVisuals(uid, component); UpdateVisuals(uid, component);
} }
@@ -74,6 +76,6 @@ public abstract class SharedHandheldLightSystem : EntitySystem
if (component.ToggleAction != null) if (component.ToggleAction != null)
_actionSystem.SetToggled(component.ToggleAction, component.Activated); _actionSystem.SetToggled(component.ToggleAction, component.Activated);
appearance.SetData(ToggleableLightVisuals.Enabled, component.Activated); _appearance.SetData(uid, ToggleableLightVisuals.Enabled, component.Activated, appearance);
} }
} }

View File

@@ -43,14 +43,17 @@ public abstract partial class SharedMoverController
/// </summary> /// </summary>
private void OnMobCollision(Fixture ourFixture, Fixture otherFixture, float frameTime, Vector2 worldNormal) private void OnMobCollision(Fixture ourFixture, Fixture otherFixture, float frameTime, Vector2 worldNormal)
{ {
if (!_pushingEnabled) return; if (!_pushingEnabled)
return;
var otherBody = otherFixture.Body; var otherBody = otherFixture.Body;
if (otherBody.BodyType != BodyType.Dynamic || !otherFixture.Hard) return; if (otherBody.BodyType != BodyType.Dynamic || !otherFixture.Hard)
return;
if (!EntityManager.TryGetComponent(ourFixture.Body.Owner, out MobMoverComponent? mobMover) || worldNormal == Vector2.Zero) return; if (!EntityManager.TryGetComponent(ourFixture.Body.Owner, out MobMoverComponent? mobMover) || worldNormal == Vector2.Zero)
return;
otherBody.ApplyLinearImpulse(-worldNormal * mobMover.PushStrengthVV * frameTime); PhysicsSystem.ApplyLinearImpulse(otherBody, -worldNormal * mobMover.PushStrengthVV * frameTime);
} }
} }

View File

@@ -1,7 +1,7 @@
namespace Content.Shared.Paper namespace Content.Shared.Paper
{ {
[RegisterComponent] [RegisterComponent]
public class StampComponent : Component public sealed class StampComponent : Component
{ {
/// <summary> /// <summary>
/// The loc string name that will be stamped to the piece of paper on examine. /// The loc string name that will be stamped to the piece of paper on examine.

View File

@@ -1,6 +1,7 @@
using System.Diagnostics.CodeAnalysis; using System.Diagnostics.CodeAnalysis;
using Content.Shared.Alert; using Content.Shared.Alert;
using Content.Shared.GameTicking; using Content.Shared.GameTicking;
using Content.Shared.Gravity;
using Content.Shared.Input; using Content.Shared.Input;
using Content.Shared.Movement.Components; using Content.Shared.Movement.Components;
using Content.Shared.Physics.Pull; using Content.Shared.Physics.Pull;
@@ -19,6 +20,7 @@ namespace Content.Shared.Pulling
public abstract partial class SharedPullingSystem : EntitySystem public abstract partial class SharedPullingSystem : EntitySystem
{ {
[Dependency] private readonly SharedPullingStateManagementSystem _pullSm = default!; [Dependency] private readonly SharedPullingStateManagementSystem _pullSm = default!;
[Dependency] private readonly SharedGravitySystem _gravity = default!;
[Dependency] private readonly AlertsSystem _alertsSystem = default!; [Dependency] private readonly AlertsSystem _alertsSystem = default!;
/// <summary> /// <summary>
@@ -197,7 +199,7 @@ namespace Content.Shared.Pulling
} }
if (_containerSystem.IsEntityInContainer(player) || if (_containerSystem.IsEntityInContainer(player) ||
player.IsWeightless(entityManager: EntityManager)) _gravity.IsWeightless(player))
return false; return false;
TryMoveTo(pullable, coords); TryMoveTo(pullable, coords);

View File

@@ -3,6 +3,7 @@ using Robust.Shared.Physics;
using System.Linq; using System.Linq;
using Content.Shared.Movement.Systems; using Content.Shared.Movement.Systems;
using Content.Shared.Revenant.Components; using Content.Shared.Revenant.Components;
using Robust.Shared.Physics.Systems;
namespace Content.Shared.Revenant.EntitySystems; namespace Content.Shared.Revenant.EntitySystems;
@@ -15,6 +16,7 @@ public abstract class SharedCorporealSystem : EntitySystem
{ {
[Dependency] private readonly SharedAppearanceSystem _appearance = default!; [Dependency] private readonly SharedAppearanceSystem _appearance = default!;
[Dependency] private readonly MovementSpeedModifierSystem _movement = default!; [Dependency] private readonly MovementSpeedModifierSystem _movement = default!;
[Dependency] private readonly SharedPhysicsSystem _physics = default!;
public override void Initialize() public override void Initialize()
{ {
@@ -38,8 +40,8 @@ public abstract class SharedCorporealSystem : EntitySystem
{ {
var fixture = fixtures.Fixtures.Values.First(); var fixture = fixtures.Fixtures.Values.First();
fixture.CollisionMask = (int) (CollisionGroup.SmallMobMask | CollisionGroup.GhostImpassable); _physics.SetCollisionMask(fixture, (int) (CollisionGroup.SmallMobMask | CollisionGroup.GhostImpassable));
fixture.CollisionLayer = (int) CollisionGroup.SmallMobLayer; _physics.SetCollisionLayer(fixture, (int) CollisionGroup.SmallMobLayer);
} }
_movement.RefreshMovementSpeedModifiers(uid); _movement.RefreshMovementSpeedModifiers(uid);
} }
@@ -52,8 +54,8 @@ public abstract class SharedCorporealSystem : EntitySystem
{ {
var fixture = fixtures.Fixtures.Values.First(); var fixture = fixtures.Fixtures.Values.First();
fixture.CollisionMask = (int) CollisionGroup.GhostImpassable; _physics.SetCollisionMask(fixture, (int) CollisionGroup.GhostImpassable);
fixture.CollisionLayer = 0; _physics.SetCollisionLayer(fixture, 0);
} }
component.MovementSpeedDebuff = 1; //just so we can avoid annoying code elsewhere component.MovementSpeedDebuff = 1; //just so we can avoid annoying code elsewhere
_movement.RefreshMovementSpeedModifiers(uid); _movement.RefreshMovementSpeedModifiers(uid);

View File

@@ -14,6 +14,8 @@ namespace Content.Shared.Singularity
public abstract class SharedSingularitySystem : EntitySystem public abstract class SharedSingularitySystem : EntitySystem
{ {
[Dependency] private readonly FixtureSystem _fixtures = default!; [Dependency] private readonly FixtureSystem _fixtures = default!;
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
[Dependency] private readonly SharedPhysicsSystem _physics = default!;
public const string DeleteFixture = "DeleteCircle"; public const string DeleteFixture = "DeleteCircle";
@@ -102,7 +104,7 @@ namespace Content.Shared.Singularity
// Prevents it getting stuck (see SingularityController.MoveSingulo) // Prevents it getting stuck (see SingularityController.MoveSingulo)
if (physics != null) if (physics != null)
{ {
physics.LinearVelocity = Vector2.Zero; _physics.SetLinearVelocity(physics, Vector2.Zero);
} }
} }
@@ -113,10 +115,7 @@ namespace Content.Shared.Singularity
source.Intensity = singularity.RadsPerLevel * value; source.Intensity = singularity.RadsPerLevel * value;
} }
if (EntityManager.TryGetComponent(singularity.Owner, out AppearanceComponent? appearance)) _appearance.SetData(singularity.Owner, SingularityVisuals.Level, value);
{
appearance.SetData(SingularityVisuals.Level, value);
}
if (physics != null) if (physics != null)
{ {

View File

@@ -9,6 +9,7 @@ using Robust.Shared.Audio;
using Robust.Shared.Containers; using Robust.Shared.Containers;
using Robust.Shared.GameStates; using Robust.Shared.GameStates;
using Robust.Shared.Physics.Components; using Robust.Shared.Physics.Components;
using Robust.Shared.Physics.Systems;
namespace Content.Shared.Slippery namespace Content.Shared.Slippery
{ {
@@ -20,6 +21,7 @@ namespace Content.Shared.Slippery
[Dependency] private readonly SharedStunSystem _stunSystem = default!; [Dependency] private readonly SharedStunSystem _stunSystem = default!;
[Dependency] private readonly StatusEffectsSystem _statusEffectsSystem = default!; [Dependency] private readonly StatusEffectsSystem _statusEffectsSystem = default!;
[Dependency] private readonly SharedContainerSystem _container = default!; [Dependency] private readonly SharedContainerSystem _container = default!;
[Dependency] private readonly SharedPhysicsSystem _physics = default!;
public override void Initialize() public override void Initialize()
{ {
@@ -43,7 +45,7 @@ namespace Content.Shared.Slippery
private void OnSlipperyGetState(EntityUid uid, SlipperyComponent component, ref ComponentGetState args) private void OnSlipperyGetState(EntityUid uid, SlipperyComponent component, ref ComponentGetState args)
{ {
args.State = new SlipperyComponentState(component.ParalyzeTime, component.LaunchForwardsMultiplier, component.SlipSound.GetSound()); args.State = new SlipperyComponentState(component.ParalyzeTime, component.LaunchForwardsMultiplier, _audio.GetSound(component.SlipSound));
} }
private void HandleStepTrigger(EntityUid uid, SlipperyComponent component, ref StepTriggeredEvent args) private void HandleStepTrigger(EntityUid uid, SlipperyComponent component, ref StepTriggeredEvent args)
@@ -81,7 +83,7 @@ namespace Content.Shared.Slippery
return; return;
if (TryComp(other, out PhysicsComponent? physics)) if (TryComp(other, out PhysicsComponent? physics))
physics.LinearVelocity *= component.LaunchForwardsMultiplier; _physics.SetLinearVelocity(physics, physics.LinearVelocity * component.LaunchForwardsMultiplier);
var playSound = !_statusEffectsSystem.HasStatusEffect(other, "KnockedDown"); var playSound = !_statusEffectsSystem.HasStatusEffect(other, "KnockedDown");

View File

@@ -15,7 +15,7 @@ namespace Content.Shared.Spawning
in Box2? box = null, in Box2? box = null,
SharedPhysicsSystem? physicsManager = null) SharedPhysicsSystem? physicsManager = null)
{ {
physicsManager ??= EntitySystem.Get<SharedPhysicsSystem>(); physicsManager ??= entityManager.System<SharedPhysicsSystem>();
var mapCoordinates = coordinates.ToMap(entityManager); var mapCoordinates = coordinates.ToMap(entityManager);
return entityManager.SpawnIfUnobstructed(prototypeName, mapCoordinates, collisionLayer, box, physicsManager); return entityManager.SpawnIfUnobstructed(prototypeName, mapCoordinates, collisionLayer, box, physicsManager);
@@ -30,7 +30,7 @@ namespace Content.Shared.Spawning
SharedPhysicsSystem? collision = null) SharedPhysicsSystem? collision = null)
{ {
var boxOrDefault = box.GetValueOrDefault(Box2.UnitCentered).Translated(coordinates.Position); var boxOrDefault = box.GetValueOrDefault(Box2.UnitCentered).Translated(coordinates.Position);
collision ??= EntitySystem.Get<SharedPhysicsSystem>(); collision ??= entityManager.System<SharedPhysicsSystem>();
foreach (var body in collision.GetCollidingEntities(coordinates.MapId, in boxOrDefault)) foreach (var body in collision.GetCollidingEntities(coordinates.MapId, in boxOrDefault))
{ {

View File

@@ -9,15 +9,16 @@ using Content.Shared.Physics;
using Robust.Shared.GameStates; using Robust.Shared.GameStates;
using Robust.Shared.Serialization; using Robust.Shared.Serialization;
using Robust.Shared.Network; using Robust.Shared.Network;
using Robust.Shared.Physics.Systems;
namespace Content.Shared.Standing namespace Content.Shared.Standing
{ {
public sealed class StandingStateSystem : EntitySystem public sealed class StandingStateSystem : EntitySystem
{ {
[Dependency] private readonly IGameTiming _gameTiming = default!; [Dependency] private readonly IGameTiming _gameTiming = default!;
[Dependency] private readonly INetManager _netMan = default!;
[Dependency] private readonly SharedAppearanceSystem _appearance = default!; [Dependency] private readonly SharedAppearanceSystem _appearance = default!;
[Dependency] private readonly SharedAudioSystem _audio = default!; [Dependency] private readonly SharedAudioSystem _audio = default!;
[Dependency] private readonly SharedPhysicsSystem _physics = default!;
// If StandingCollisionLayer value is ever changed to more than one layer, the logic needs to be edited. // If StandingCollisionLayer value is ever changed to more than one layer, the logic needs to be edited.
private const int StandingCollisionLayer = (int) CollisionGroup.MidImpassable; private const int StandingCollisionLayer = (int) CollisionGroup.MidImpassable;
@@ -96,7 +97,7 @@ namespace Content.Shared.Standing
continue; continue;
standingState.ChangedFixtures.Add(key); standingState.ChangedFixtures.Add(key);
fixture.CollisionMask &= ~StandingCollisionLayer; _physics.SetCollisionMask(fixture, fixture.CollisionMask & ~StandingCollisionLayer);
} }
} }
@@ -142,7 +143,7 @@ namespace Content.Shared.Standing
foreach (var key in standingState.ChangedFixtures) foreach (var key in standingState.ChangedFixtures)
{ {
if (fixtureComponent.Fixtures.TryGetValue(key, out var fixture)) if (fixtureComponent.Fixtures.TryGetValue(key, out var fixture))
fixture.CollisionMask |= StandingCollisionLayer; _physics.SetCollisionMask(fixture, fixture.CollisionMask | StandingCollisionLayer);
} }
} }
standingState.ChangedFixtures.Clear(); standingState.ChangedFixtures.Clear();

View File

@@ -8,6 +8,8 @@ namespace Content.Shared.Storage.EntitySystems
[UsedImplicitly] [UsedImplicitly]
public abstract class SharedItemCounterSystem : EntitySystem public abstract class SharedItemCounterSystem : EntitySystem
{ {
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
/// <inheritdoc /> /// <inheritdoc />
public override void Initialize() public override void Initialize()
{ {
@@ -19,30 +21,32 @@ namespace Content.Shared.Storage.EntitySystems
private void CounterEntityInserted(EntityUid uid, ItemCounterComponent itemCounter, private void CounterEntityInserted(EntityUid uid, ItemCounterComponent itemCounter,
EntInsertedIntoContainerMessage args) EntInsertedIntoContainerMessage args)
{ {
if (!EntityManager.TryGetComponent(itemCounter.Owner, out AppearanceComponent? appearanceComponent)) return; if (!EntityManager.TryGetComponent(itemCounter.Owner, out AppearanceComponent? appearanceComponent))
return;
var count = GetCount(args, itemCounter); var count = GetCount(args, itemCounter);
if (count == null) if (count == null)
return; return;
appearanceComponent.SetData(StackVisuals.Actual, count); _appearance.SetData(itemCounter.Owner, StackVisuals.Actual, count, appearanceComponent);
if (itemCounter.MaxAmount != null)
appearanceComponent.SetData(StackVisuals.MaxCount, itemCounter.MaxAmount);
if (itemCounter.MaxAmount != null)
_appearance.SetData(itemCounter.Owner, StackVisuals.MaxCount, itemCounter.MaxAmount, appearanceComponent);
} }
private void CounterEntityRemoved(EntityUid uid, ItemCounterComponent itemCounter, private void CounterEntityRemoved(EntityUid uid, ItemCounterComponent itemCounter,
EntRemovedFromContainerMessage args) EntRemovedFromContainerMessage args)
{ {
if (!EntityManager.TryGetComponent(itemCounter.Owner, out AppearanceComponent? appearanceComponent)) return; if (!EntityManager.TryGetComponent(itemCounter.Owner, out AppearanceComponent? appearanceComponent))
return;
var count = GetCount(args, itemCounter); var count = GetCount(args, itemCounter);
if (count == null) if (count == null)
return; return;
appearanceComponent.SetData(StackVisuals.Actual, count); _appearance.SetData(itemCounter.Owner, StackVisuals.Actual, count, appearanceComponent);
if (itemCounter.MaxAmount != null) if (itemCounter.MaxAmount != null)
appearanceComponent.SetData(StackVisuals.MaxCount, itemCounter.MaxAmount); _appearance.SetData(itemCounter.Owner, StackVisuals.MaxCount, itemCounter.MaxAmount, appearanceComponent);
} }
protected abstract int? GetCount(ContainerModifiedMessage msg, ItemCounterComponent itemCounter); protected abstract int? GetCount(ContainerModifiedMessage msg, ItemCounterComponent itemCounter);

View File

@@ -25,6 +25,7 @@ namespace Content.Shared.Stunnable
[Dependency] private readonly StandingStateSystem _standingStateSystem = default!; [Dependency] private readonly StandingStateSystem _standingStateSystem = default!;
[Dependency] private readonly StatusEffectsSystem _statusEffectSystem = default!; [Dependency] private readonly StatusEffectsSystem _statusEffectSystem = default!;
[Dependency] private readonly MovementSpeedModifierSystem _movementSpeedModifierSystem = default!; [Dependency] private readonly MovementSpeedModifierSystem _movementSpeedModifierSystem = default!;
[Dependency] private readonly SharedAudioSystem _audio = default!;
/// <summary> /// <summary>
/// Friction modifier for knocked down players. /// Friction modifier for knocked down players.
@@ -221,9 +222,7 @@ namespace Content.Shared.Stunnable
knocked.HelpTimer = knocked.HelpInterval/2f; knocked.HelpTimer = knocked.HelpInterval/2f;
_statusEffectSystem.TryRemoveTime(uid, "KnockedDown", TimeSpan.FromSeconds(knocked.HelpInterval)); _statusEffectSystem.TryRemoveTime(uid, "KnockedDown", TimeSpan.FromSeconds(knocked.HelpInterval));
_audio.PlayPredicted(knocked.StunAttemptSound, uid, args.User);
SoundSystem.Play(knocked.StunAttemptSound.GetSound(), Filter.Pvs(uid), uid, AudioHelpers.WithVariation(0.05f));
Dirty(knocked); Dirty(knocked);
args.Handled = true; args.Handled = true;

View File

@@ -70,6 +70,9 @@
# - type: ExtensionCableReceiver # - type: ExtensionCableReceiver
- type: PowerSupplier - type: PowerSupplier
supplyRate: 0 supplyRate: 0
- type: ContainerContainer
containers:
AMEController-fuelJarContainer: !type:ContainerSlot {}
- type: entity - type: entity
noSpawn: true noSpawn: true