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.Kitchen.EntitySystems
SubscribeLocalEvent<ReagentGrinderComponent, ComponentInit>(OnComponentInit);
SubscribeLocalEvent<ReagentGrinderComponent, ComponentRemove>(OnComponentRemove);
SubscribeLocalEvent<ReagentGrinderComponent, PowerChangedEvent>((_, component, _) => EnqueueUiUpdate(component));
SubscribeLocalEvent<ReagentGrinderComponent, PowerChangedEvent>(OnPowerChange);
SubscribeLocalEvent<ReagentGrinderComponent, InteractUsingEvent>(OnInteractUsing);
SubscribeLocalEvent<StackComponent, ExtractableScalingEvent>(ExtractableScaling);
@@ -43,6 +43,11 @@ namespace Content.Server.Kitchen.EntitySystems
SubscribeLocalEvent<ReagentGrinderComponent, ContainerIsRemovingAttemptEvent>(OnEntRemoveAttempt);
}
private void OnPowerChange(EntityUid uid, ReagentGrinderComponent component, ref PowerChangedEvent args)
{
EnqueueUiUpdate(component);
}
private void OnEntRemoveAttempt(EntityUid uid, ReagentGrinderComponent component, ContainerIsRemovingAttemptEvent args)
{
if (component.Busy)