Fix errors
This commit is contained in:
@@ -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(
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user