Fix errors
This commit is contained in:
@@ -102,7 +102,7 @@ namespace Content.Server.Light.Components
|
||||
/// Illuminates the light if it is not active, extinguishes it if it is active.
|
||||
/// </summary>
|
||||
/// <returns>True if the light's status was toggled, false otherwise.</returns>
|
||||
public bool ToggleStatus(EntityUiduser)
|
||||
public bool ToggleStatus(EntityUid user)
|
||||
{
|
||||
if (!EntitySystem.Get<ActionBlockerSystem>().CanUse(user)) return false;
|
||||
return Activated ? TurnOff() : TurnOn(user);
|
||||
@@ -128,7 +128,7 @@ namespace Content.Server.Light.Components
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool TurnOn(EntityUiduser)
|
||||
public bool TurnOn(EntityUid user)
|
||||
{
|
||||
if (Activated)
|
||||
{
|
||||
|
||||
@@ -58,7 +58,7 @@ namespace Content.Server.Light.EntitySystems
|
||||
args.IsHot = component.CurrentState == SmokableState.Lit;
|
||||
}
|
||||
|
||||
public void Ignite(MatchstickComponent component, EntityUiduser)
|
||||
public void Ignite(MatchstickComponent component, EntityUid user)
|
||||
{
|
||||
// Play Sound
|
||||
SoundSystem.Play(
|
||||
|
||||
@@ -154,7 +154,7 @@ namespace Content.Server.Light.EntitySystems
|
||||
return false;
|
||||
|
||||
// try to insert bulb in container
|
||||
if (!light.LightBulbContainer.Insert(EntityManager.GetEntity(bulbUid)))
|
||||
if (!light.LightBulbContainer.Insert(bulbUid))
|
||||
return false;
|
||||
|
||||
UpdateLight(uid, light);
|
||||
@@ -172,24 +172,22 @@ namespace Content.Server.Light.EntitySystems
|
||||
return null;
|
||||
|
||||
// check if light has bulb
|
||||
var bulbUid = GetBulb(uid, light);
|
||||
if (bulbUid == null)
|
||||
if (GetBulb(uid, light) is not {Valid: true} bulb)
|
||||
return null;
|
||||
|
||||
// try to remove bulb from container
|
||||
var bulbbulbUid.Value
|
||||
if (!light.LightBulbContainer.Remove(bulbEnt))
|
||||
if (!light.LightBulbContainer.Remove(bulb))
|
||||
return null;
|
||||
|
||||
// try to place bulb in hands
|
||||
if (userUid != null)
|
||||
{
|
||||
if (EntityManager.TryGetComponent(userUid.Value, out SharedHandsComponent? hands))
|
||||
hands.TryPutInActiveHandOrAny(bulbEnt);
|
||||
hands.TryPutInActiveHandOrAny(bulb);
|
||||
}
|
||||
|
||||
UpdateLight(uid, light);
|
||||
return bulbUid;
|
||||
return bulb;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user