Fix errors

This commit is contained in:
DrSmugleaf
2021-12-05 21:02:04 +01:00
parent 2a3b7d809d
commit ab9d0cc6d8
94 changed files with 568 additions and 591 deletions

View File

@@ -68,9 +68,8 @@ namespace Content.Server.Disposal.Tube
return;
}
var uid
component.LastClang = _gameTiming.CurTime;
SoundSystem.Play(Filter.Pvs(entity), component.ClangSound.GetSound(), entity);
SoundSystem.Play(Filter.Pvs(uid), component.ClangSound.GetSound(), uid);
}
private static void BodyTypeChanged(

View File

@@ -38,13 +38,13 @@ namespace Content.Server.Disposal
}
var entityManager = IoCManager.Resolve<IEntityManager>();
if (!entityManager.EntityExists(id)
if (!entityManager.EntityExists(id))
{
shell.WriteLine(Loc.GetString("shell-could-not-find-entity-with-uid",("uid", id)));
return;
}
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(entity, out IDisposalTubeComponent? tube))
if (!entityManager.TryGetComponent(id, out IDisposalTubeComponent? tube))
{
shell.WriteLine(Loc.GetString("shell-entity-with-uid-lacks-component",
("uid", id),
@@ -52,7 +52,7 @@ namespace Content.Server.Disposal
return;
}
tube.PopupDirections(player.AttachedEntity);
tube.PopupDirections(player.AttachedEntity.Value);
}
}
}

View File

@@ -108,12 +108,12 @@ namespace Content.Server.Disposal.Unit.Components
public void OnUiReceiveMessage(ServerBoundUserInterfaceMessage obj)
{
if (obj.Session.AttachedEntity == null)
if (obj.Session.AttachedEntity is not {Valid: true} player)
{
return;
}
if (!PlayerCanUse(obj.Session.AttachedEntity))
if (!PlayerCanUse(player))
{
return;
}

View File

@@ -116,7 +116,7 @@ namespace Content.Server.Disposal.Unit.EntitySystems
private void DoInsertDisposalUnit(DoInsertDisposalUnitEvent ev)
{
var toInsert = ev.ToInsert
var toInsert = ev.ToInsert;
if (!EntityManager.TryGetComponent(ev.Unit, out DisposalUnitComponent? unit))
{