Raise power events by ref and not broadcast (#11923)
Also some other minor stuff.
This commit is contained in:
@@ -13,7 +13,7 @@ namespace Content.Server.Audio
|
||||
SubscribeLocalEvent<AmbientOnPoweredComponent, PowerNetBatterySupplyEvent>(HandlePowerSupply);
|
||||
}
|
||||
|
||||
private void HandlePowerSupply(EntityUid uid, AmbientOnPoweredComponent component, PowerNetBatterySupplyEvent args)
|
||||
private void HandlePowerSupply(EntityUid uid, AmbientOnPoweredComponent component, ref PowerNetBatterySupplyEvent args)
|
||||
{
|
||||
if (!EntityManager.TryGetComponent<AmbientSoundComponent>(uid, out var ambientSound)) return;
|
||||
if (ambientSound.Enabled == args.Supply) return;
|
||||
@@ -21,7 +21,7 @@ namespace Content.Server.Audio
|
||||
Dirty(ambientSound);
|
||||
}
|
||||
|
||||
private void HandlePowerChange(EntityUid uid, AmbientOnPoweredComponent component, PowerChangedEvent args)
|
||||
private void HandlePowerChange(EntityUid uid, AmbientOnPoweredComponent component, ref PowerChangedEvent args)
|
||||
{
|
||||
if (!EntityManager.TryGetComponent<AmbientSoundComponent>(uid, out var ambientSound)) return;
|
||||
if (ambientSound.Enabled == args.Powered) return;
|
||||
|
||||
Reference in New Issue
Block a user