Raise power events by ref and not broadcast (#11923)

Also some other minor stuff.
This commit is contained in:
metalgearsloth
2022-10-15 15:08:15 +11:00
committed by GitHub
parent 920fde469d
commit 0b38589728
40 changed files with 89 additions and 80 deletions

View File

@@ -34,7 +34,7 @@ namespace Content.Server.Light.EntitySystems
SubscribeLocalEvent<EmergencyLightComponent, PowerChangedEvent>(OnEmergencyPower);
}
private void OnEmergencyPower(EntityUid uid, EmergencyLightComponent component, PowerChangedEvent args)
private void OnEmergencyPower(EntityUid uid, EmergencyLightComponent component, ref PowerChangedEvent args)
{
UpdateState(component);
}

View File

@@ -14,7 +14,7 @@ namespace Content.Server.Light.EntitySystems
SubscribeLocalEvent<LitOnPoweredComponent, PowerNetBatterySupplyEvent>(OnPowerSupply);
}
private void OnPowerChanged(EntityUid uid, LitOnPoweredComponent component, PowerChangedEvent args)
private void OnPowerChanged(EntityUid uid, LitOnPoweredComponent component, ref PowerChangedEvent args)
{
if (EntityManager.TryGetComponent<PointLightComponent>(uid, out var light))
{
@@ -22,7 +22,7 @@ namespace Content.Server.Light.EntitySystems
}
}
private void OnPowerSupply(EntityUid uid, LitOnPoweredComponent component, PowerNetBatterySupplyEvent args)
private void OnPowerSupply(EntityUid uid, LitOnPoweredComponent component, ref PowerNetBatterySupplyEvent args)
{
if (EntityManager.TryGetComponent<PointLightComponent>(uid, out var light))
{

View File

@@ -347,7 +347,7 @@ namespace Content.Server.Light.EntitySystems
args.Handled = true;
}
private void OnPowerChanged(EntityUid uid, PoweredLightComponent component, PowerChangedEvent args)
private void OnPowerChanged(EntityUid uid, PoweredLightComponent component, ref PowerChangedEvent args)
{
UpdateLight(uid, component);
}