Special digestion & kudzu-eating (#16061)
This commit is contained in:
@@ -5,6 +5,7 @@ using Content.Server.NPC.Queries.Considerations;
|
||||
using Content.Server.NPC.Queries.Curves;
|
||||
using Content.Server.NPC.Queries.Queries;
|
||||
using Content.Server.Nutrition.Components;
|
||||
using Content.Server.Nutrition.EntitySystems;
|
||||
using Content.Server.Storage.Components;
|
||||
using Content.Shared.Examine;
|
||||
using Content.Shared.Mobs.Systems;
|
||||
@@ -24,6 +25,7 @@ public sealed class NPCUtilitySystem : EntitySystem
|
||||
[Dependency] private readonly FactionSystem _faction = default!;
|
||||
[Dependency] private readonly MobStateSystem _mobState = default!;
|
||||
[Dependency] private readonly SharedTransformSystem _transform = default!;
|
||||
[Dependency] private readonly FoodSystem _food = default!;
|
||||
|
||||
/// <summary>
|
||||
/// Runs the UtilityQueryPrototype and returns the best-matching entities.
|
||||
@@ -120,6 +122,11 @@ public sealed class NPCUtilitySystem : EntitySystem
|
||||
if (!TryComp<FoodComponent>(targetUid, out var food))
|
||||
return 0f;
|
||||
|
||||
var owner = blackboard.GetValue<EntityUid>(NPCBlackboard.Owner);
|
||||
|
||||
if (!_food.IsDigestibleBy(owner, targetUid, food))
|
||||
return 0f;
|
||||
|
||||
return 1f;
|
||||
}
|
||||
case TargetAccessibleCon:
|
||||
|
||||
Reference in New Issue
Block a user