Remove NPC IEntityManager resolves (#12648)

This commit is contained in:
metalgearsloth
2022-11-19 08:07:52 +11:00
committed by GitHub
parent c58204255f
commit b749d0d275
16 changed files with 46 additions and 44 deletions

View File

@@ -29,7 +29,7 @@ public sealed class RangedOperator : HTNOperator
CancellationToken cancelToken)
{
// Don't attack if they're already as wounded as we want them.
if (!blackboard.TryGetValue<EntityUid>(TargetKey, out var target))
if (!blackboard.TryGetValue<EntityUid>(TargetKey, out var target, _entManager))
{
return (false, null);
}
@@ -50,12 +50,12 @@ public sealed class RangedOperator : HTNOperator
var ranged = _entManager.EnsureComponent<NPCRangedCombatComponent>(blackboard.GetValue<EntityUid>(NPCBlackboard.Owner));
ranged.Target = blackboard.GetValue<EntityUid>(TargetKey);
if (blackboard.TryGetValue<float>(NPCBlackboard.RotateSpeed, out var rotSpeed))
if (blackboard.TryGetValue<float>(NPCBlackboard.RotateSpeed, out var rotSpeed, _entManager))
{
ranged.RotationSpeed = new Angle(rotSpeed);
}
if (blackboard.TryGetValue<SoundSpecifier>("SoundTargetInLOS", out var losSound))
if (blackboard.TryGetValue<SoundSpecifier>("SoundTargetInLOS", out var losSound, _entManager))
{
ranged.SoundTargetInLOS = losSound;
}