Fix a bunch of warnings (#11965)
Co-authored-by: metalgearsloth <metalgearsloth@gmail.com>
This commit is contained in:
@@ -23,6 +23,8 @@ namespace Content.Server.Toilet
|
||||
public sealed class ToiletSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly IRobustRandom _random = default!;
|
||||
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
|
||||
[Dependency] private readonly SharedAudioSystem _audio = default!;
|
||||
[Dependency] private readonly SecretStashSystem _secretStash = default!;
|
||||
[Dependency] private readonly PopupSystem _popupSystem = default!;
|
||||
[Dependency] private readonly ToolSystem _toolSystem = default!;
|
||||
@@ -42,7 +44,8 @@ namespace Content.Server.Toilet
|
||||
|
||||
private void OnSuicide(EntityUid uid, ToiletComponent component, SuicideEvent args)
|
||||
{
|
||||
if (args.Handled) return;
|
||||
if (args.Handled)
|
||||
return;
|
||||
|
||||
// Check that victim has a head
|
||||
if (EntityManager.TryGetComponent<SharedBodyComponent>(args.Victim, out var body) &&
|
||||
@@ -180,19 +183,17 @@ namespace Content.Server.Toilet
|
||||
return;
|
||||
|
||||
component.IsSeatUp = !component.IsSeatUp;
|
||||
SoundSystem.Play(component.ToggleSound.GetSound(), Filter.Pvs(uid),
|
||||
uid, AudioHelpers.WithVariation(0.05f));
|
||||
|
||||
_audio.PlayPvs(component.ToggleSound, uid, AudioParams.Default.WithVariation(0.05f));
|
||||
UpdateSprite(uid, component);
|
||||
}
|
||||
|
||||
private void UpdateSprite(EntityUid uid, ToiletComponent component)
|
||||
{
|
||||
if (!EntityManager.TryGetComponent(uid,out AppearanceComponent? appearance))
|
||||
if (!EntityManager.TryGetComponent(uid, out AppearanceComponent? appearance))
|
||||
return;
|
||||
|
||||
appearance.SetData(ToiletVisuals.LidOpen, component.LidOpen);
|
||||
appearance.SetData(ToiletVisuals.SeatUp, component.IsSeatUp);
|
||||
_appearance.SetData(uid, ToiletVisuals.LidOpen, component.LidOpen, appearance);
|
||||
_appearance.SetData(uid, ToiletVisuals.SeatUp, component.IsSeatUp, appearance);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user