Convert DisposalUnitVisualizer to VisualizerSystem (#13637)
This commit is contained in:
@@ -39,13 +39,17 @@ namespace Content.Server.Disposal.Unit.EntitySystems
|
||||
// *This ejection also makes the target not collide with the unit.*
|
||||
// *This is on purpose.*
|
||||
|
||||
EntityUid? disposalId = null;
|
||||
DisposalUnitComponent? duc = null;
|
||||
if (_mapManager.TryGetGrid(holderTransform.GridUid, out var grid))
|
||||
{
|
||||
foreach (var contentUid in grid.GetLocal(holderTransform.Coordinates))
|
||||
{
|
||||
if (EntityManager.TryGetComponent(contentUid, out duc))
|
||||
{
|
||||
disposalId = contentUid;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,9 +75,9 @@ namespace Content.Server.Disposal.Unit.EntitySystems
|
||||
}
|
||||
}
|
||||
|
||||
if (duc != null)
|
||||
if (disposalId != null && duc != null)
|
||||
{
|
||||
_disposalUnitSystem.TryEjectContents(duc);
|
||||
_disposalUnitSystem.TryEjectContents(disposalId.Value, duc);
|
||||
}
|
||||
|
||||
if (_atmosphereSystem.GetContainingMixture(uid, false, true) is {} environment)
|
||||
|
||||
Reference in New Issue
Block a user