Cleanup event handler methods with nullable parameters (#45070)

This commit is contained in:
Tayrtahn 2026-07-31 23:12:26 -04:00 • committed by GitHub
parent 8e687ad96e
commit 976463abce
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 10 additions and 13 deletions

View file

@ -174,7 +174,7 @@ namespace Content.Client.Actions
LinkAllActions(component);
}
private void OnPlayerDetached(EntityUid uid, ActionsComponent component, LocalPlayerDetachedEvent? args = null)
private void OnPlayerDetached(EntityUid uid, ActionsComponent component, LocalPlayerDetachedEvent args)
{
UnlinkAllActions();
}

View file

@ -30,7 +30,7 @@ public sealed partial class ChemistryGuideDataSystem : SharedChemistryGuideDataS
SubscribeNetworkEvent<ReagentGuideRegistryChangedEvent>(OnReceiveRegistryUpdate);
SubscribeLocalEvent<PrototypesReloadedEventArgs>(OnPrototypesReloaded);
OnPrototypesReloaded(null);
LoadPrototypes(null);
}
private void OnReceiveRegistryUpdate(ReagentGuideRegistryChangedEvent message)
@ -47,7 +47,12 @@ public sealed partial class ChemistryGuideDataSystem : SharedChemistryGuideDataS
}
}
private void OnPrototypesReloaded(PrototypesReloadedEventArgs? ev)
private void OnPrototypesReloaded(PrototypesReloadedEventArgs ev)
{
LoadPrototypes(ev);
}
private void LoadPrototypes(PrototypesReloadedEventArgs? args)
{
// this doesn't check what prototypes are being reloaded because, to be frank, we use a lot of them.
_reagentSources.Clear();

View file

@ -37,13 +37,8 @@ public sealed partial class HandheldLightSystem : SharedHandheldLightSystem
return true;
}
private void OnAppearanceChange(EntityUid uid, HandheldLightComponent? component, ref AppearanceChangeEvent args)
private void OnAppearanceChange(EntityUid uid, HandheldLightComponent component, ref AppearanceChangeEvent args)
{
if (!Resolve(uid, ref component))
{
return;
}
if (!_appearance.TryGetData<bool>(uid, ToggleableVisuals.Enabled, out var enabled, args.Component))
{
return;

View file

@ -441,11 +441,8 @@ public abstract partial class SharedCryoPodSystem : EntitySystem
}
}
protected void OnEmagged(EntityUid uid, CryoPodComponent? cryoPodComponent, ref GotEmaggedEvent args)
protected void OnEmagged(EntityUid uid, CryoPodComponent cryoPodComponent, ref GotEmaggedEvent args)
{
if (!Resolve(uid, ref cryoPodComponent))
return;
if (!_emag.CompareFlag(args.Type, EmagType.Interaction))
return;