Minor resolve light update (#4366)

This commit is contained in:
metalgearsloth
2023-09-13 00:32:02 +10:00
committed by GitHub
parent aed53fb63d
commit 22aeec45f9
2 changed files with 8 additions and 12 deletions

View File

@@ -41,14 +41,12 @@ namespace Robust.Client.GameObjects
public override bool ResolveLight(EntityUid uid, [NotNullWhen(true)] ref SharedPointLightComponent? component)
{
if (TryComp<PointLightComponent>(uid, out var comp))
{
component = comp;
if (component is not null)
return true;
}
component = null;
return false;
TryComp<PointLightComponent>(uid, out var comp);
component = comp;
return component != null;
}
public override bool TryGetLight(EntityUid uid, [NotNullWhen(true)] out SharedPointLightComponent? component)

View File

@@ -33,14 +33,12 @@ public sealed class PointLightSystem : SharedPointLightSystem
public override bool ResolveLight(EntityUid uid, [NotNullWhen(true)] ref SharedPointLightComponent? component)
{
if (TryComp<PointLightComponent>(uid, out var comp))
{
component = comp;
if (component is not null)
return true;
}
component = null;
return false;
TryComp<PointLightComponent>(uid, out var comp);
component = comp;
return component != null;
}
public override bool TryGetLight(EntityUid uid, [NotNullWhen(true)] out SharedPointLightComponent? component)