Make DisposalUnitComponent.TryInsert ECS (#4959)

This commit is contained in:
Javier Guardia Fernández
2021-10-20 21:12:23 +02:00
committed by GitHub
parent ecbcab4824
commit 3e5a856948
5 changed files with 115 additions and 73 deletions

View File

@@ -63,11 +63,19 @@ namespace Content.Shared.Disposal
if (!entity.TryGetComponent(out IPhysBody? physics) ||
!physics.CanCollide && storable == null)
{
if (!(entity.TryGetComponent(out IMobStateComponent? damageState) && damageState.IsDead())) {
if (!(entity.TryGetComponent(out IMobStateComponent? damageState) && damageState.IsDead()))
{
return false;
}
}
return true;
}
public bool CanInsert(SharedDisposalUnitComponent component, EntityUid entityId)
{
var entity = EntityManager.GetEntity(entityId);
return CanInsert(component, entity);
}
}
}