Inline TryGetComponent completely, for real

This commit is contained in:
Vera Aguilera Puerto
2021-12-03 14:17:01 +01:00
parent 2ff4ec65d5
commit 69b270017b
425 changed files with 1143 additions and 995 deletions

View File

@@ -2,6 +2,8 @@ using Content.Server.AI.WorldState;
using Content.Server.AI.WorldState.States;
using Content.Server.Nutrition.Components;
using Content.Shared.Nutrition.Components;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
namespace Content.Server.AI.Utility.Considerations.Nutrition.Food
{
@@ -12,7 +14,7 @@ namespace Content.Server.AI.Utility.Considerations.Nutrition.Food
{
var owner = context.GetState<SelfState>().GetValue();
if (owner == null || !owner.TryGetComponent(out HungerComponent? hunger))
if (owner == null || !IoCManager.Resolve<IEntityManager>().TryGetComponent(owner.Uid, out HungerComponent? hunger))
{
return 0.0f;
}