Gets rid of all ComponentManager usages. (#4707)

This commit is contained in:
Vera Aguilera Puerto
2021-09-28 13:35:29 +02:00
committed by GitHub
parent 7953e5b962
commit 0be5ff829b
158 changed files with 321 additions and 333 deletions

View File

@@ -46,7 +46,7 @@ namespace Content.Server.Wieldable
public bool CanWield(EntityUid uid, WieldableComponent component, IEntity user, bool quiet=false)
{
// Do they have enough hands free?
if (!ComponentManager.TryGetComponent<HandsComponent>(user.Uid, out var hands))
if (!EntityManager.TryGetComponent<HandsComponent>(user.Uid, out var hands))
{
if(!quiet)
user.PopupMessage(Loc.GetString("wieldable-component-no-hands"));
@@ -138,7 +138,7 @@ namespace Content.Server.Wieldable
if (!CanWield(uid, component, args.User) || component.Wielded)
return;
if (ComponentManager.TryGetComponent<ItemComponent>(uid, out var item))
if (EntityManager.TryGetComponent<ItemComponent>(uid, out var item))
{
component.OldInhandPrefix = item.EquippedPrefix;
item.EquippedPrefix = component.WieldedInhandPrefix;
@@ -167,7 +167,7 @@ namespace Content.Server.Wieldable
if (!component.Wielded)
return;
if (ComponentManager.TryGetComponent<ItemComponent>(uid, out var item))
if (EntityManager.TryGetComponent<ItemComponent>(uid, out var item))
{
item.EquippedPrefix = component.OldInhandPrefix;
}
@@ -204,7 +204,7 @@ namespace Content.Server.Wieldable
private void OnMeleeHit(EntityUid uid, IncreaseDamageOnWieldComponent component, MeleeHitEvent args)
{
if (ComponentManager.TryGetComponent<WieldableComponent>(uid, out var wield))
if (EntityManager.TryGetComponent<WieldableComponent>(uid, out var wield))
{
if (!wield.Wielded)
return;