Gets rid of all ComponentManager usages. (#4707)
This commit is contained in:
committed by
GitHub
parent
7953e5b962
commit
0be5ff829b
@@ -41,7 +41,7 @@ namespace Content.Server.Stunnable
|
||||
if (!comp.Activated || !args.HitEntities.Any())
|
||||
return;
|
||||
|
||||
if (!ComponentManager.TryGetComponent<PowerCellSlotComponent>(uid, out var slot) || slot.Cell == null || !slot.Cell.TryUseCharge(comp.EnergyPerUse))
|
||||
if (!EntityManager.TryGetComponent<PowerCellSlotComponent>(uid, out var slot) || slot.Cell == null || !slot.Cell.TryUseCharge(comp.EnergyPerUse))
|
||||
return;
|
||||
|
||||
foreach (IEntity entity in args.HitEntities)
|
||||
@@ -55,7 +55,7 @@ namespace Content.Server.Stunnable
|
||||
if (!comp.Activated)
|
||||
return;
|
||||
|
||||
if (!ComponentManager.TryGetComponent<PowerCellSlotComponent>(uid, out var slot) || slot.Cell == null || !slot.Cell.TryUseCharge(comp.EnergyPerUse))
|
||||
if (!EntityManager.TryGetComponent<PowerCellSlotComponent>(uid, out var slot) || slot.Cell == null || !slot.Cell.TryUseCharge(comp.EnergyPerUse))
|
||||
return;
|
||||
|
||||
if (args.Entity.HasComponent<StunnableComponent>())
|
||||
@@ -82,7 +82,7 @@ namespace Content.Server.Stunnable
|
||||
|
||||
private void OnThrowCollide(EntityUid uid, StunbatonComponent comp, ThrowDoHitEvent args)
|
||||
{
|
||||
if (!ComponentManager.TryGetComponent<PowerCellSlotComponent>(uid, out var slot)) return;
|
||||
if (!EntityManager.TryGetComponent<PowerCellSlotComponent>(uid, out var slot)) return;
|
||||
if (!comp.Activated || slot.Cell == null || !slot.Cell.TryUseCharge(comp.EnergyPerUse)) return;
|
||||
|
||||
StunEntity(args.Target, comp);
|
||||
@@ -101,7 +101,7 @@ namespace Content.Server.Stunnable
|
||||
if (!Get<ActionBlockerSystem>().CanInteract(args.User))
|
||||
return;
|
||||
|
||||
if (ComponentManager.TryGetComponent<PowerCellSlotComponent>(uid, out var cellslot))
|
||||
if (EntityManager.TryGetComponent<PowerCellSlotComponent>(uid, out var cellslot))
|
||||
cellslot.InsertCell(args.Used);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user