Fix a few warnings (#11576)

This commit is contained in:
metalgearsloth
2022-10-04 14:24:19 +11:00
committed by GitHub
parent a6d20803a6
commit 600c0e3255
43 changed files with 185 additions and 167 deletions

View File

@@ -16,6 +16,8 @@ namespace Content.Shared.Standing
{
[Dependency] private readonly IGameTiming _gameTiming = default!;
[Dependency] private readonly INetManager _netMan = default!;
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
[Dependency] private readonly SharedAudioSystem _audio = default!;
// If StandingCollisionLayer value is ever changed to more than one layer, the logic needs to be edited.
private const int StandingCollisionLayer = (int) CollisionGroup.MidImpassable;
@@ -28,10 +30,11 @@ namespace Content.Shared.Standing
private void OnHandleState(EntityUid uid, StandingStateComponent component, ref ComponentHandleState args)
{
if (args.Current is not StandingComponentState state) return;
if (args.Current is not StandingComponentState state)
return;
component.Standing = state.Standing;
component.ChangedFixtures = new(state.ChangedFixtures);
component.ChangedFixtures = new List<string>(state.ChangedFixtures);
}
private void OnGetState(EntityUid uid, StandingStateComponent component, ref ComponentGetState args)
@@ -82,7 +85,7 @@ namespace Content.Shared.Standing
RaiseLocalEvent(uid, new DownedEvent(), false);
// Seemed like the best place to put it
appearance?.SetData(RotationVisuals.RotationState, RotationState.Horizontal);
_appearance.SetData(uid, RotationVisuals.RotationState, RotationState.Horizontal, appearance);
// Change collision masks to allow going under certain entities like flaps and tables
if (TryComp(uid, out FixturesComponent? fixtureComponent))
@@ -100,10 +103,9 @@ namespace Content.Shared.Standing
if (!_gameTiming.IsFirstTimePredicted)
return true;
// TODO audio prediction
if (playSound && _netMan.IsServer)
if (playSound)
{
SoundSystem.Play(standingState.DownSound.GetSound(), Filter.Pvs(uid), uid, AudioHelpers.WithVariation(0.25f));
_audio.PlayPredicted(standingState.DownSound, uid, uid, AudioParams.Default.WithVariation(0.25f));
}
return true;
@@ -133,7 +135,7 @@ namespace Content.Shared.Standing
Dirty(standingState);
RaiseLocalEvent(uid, new StoodEvent(), false);
appearance?.SetData(RotationVisuals.RotationState, RotationState.Vertical);
_appearance.SetData(uid, RotationVisuals.RotationState, RotationState.Vertical, appearance);
if (TryComp(uid, out FixturesComponent? fixtureComponent))
{