Gets rid of all ComponentManager usages. (#4707)
This commit is contained in:
committed by
GitHub
parent
7953e5b962
commit
0be5ff829b
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user