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

@@ -14,6 +14,8 @@ public abstract class SharedHandheldLightSystem : EntitySystem
[Dependency] private readonly SharedItemSystem _itemSys = default!;
[Dependency] private readonly ClothingSystem _clothingSys = default!;
[Dependency] private readonly SharedActionsSystem _actionSystem = default!;
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
[Dependency] private readonly SharedAudioSystem _audio = default!;
public override void Initialize()
{
@@ -52,9 +54,9 @@ public abstract class SharedHandheldLightSystem : EntitySystem
if (makeNoise)
{
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);
UpdateVisuals(uid, component);
}
@@ -74,6 +76,6 @@ public abstract class SharedHandheldLightSystem : EntitySystem
if (component.ToggleAction != null)
_actionSystem.SetToggled(component.ToggleAction, component.Activated);
appearance.SetData(ToggleableLightVisuals.Enabled, component.Activated);
_appearance.SetData(uid, ToggleableLightVisuals.Enabled, component.Activated, appearance);
}
}