Fixes NPCs that lack a UseDelay component failing to interact with objects (#23638)

fixes NPCs failing to interact with objects

(cherry picked from commit abfa9ff856)
This commit is contained in:
deathride58
2024-01-26 22:03:42 +01:00
committed by Debug
parent bfe9ab9789
commit 77c8bfdfa8
@@ -18,8 +18,7 @@ public sealed partial class InteractWithOperator : HTNOperator
{
var owner = blackboard.GetValue<EntityUid>(NPCBlackboard.Owner);
if (!_entManager.TryGetComponent<UseDelayComponent>(owner, out var useDelay) ||
_entManager.System<UseDelaySystem>().IsDelayed((owner, useDelay)) ||
if (_entManager.TryGetComponent<UseDelayComponent>(owner, out var useDelay) && _entManager.System<UseDelaySystem>().IsDelayed((owner, useDelay)) ||
!blackboard.TryGetValue<EntityUid>(TargetKey, out var moveTarget, _entManager) ||
!_entManager.TryGetComponent<TransformComponent>(moveTarget, out var targetXform))
{