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

fixes NPCs failing to interact with objects
This commit is contained in:
deathride58
2024-01-06 15:32:50 -05:00
committed by GitHub
parent f5909f68ae
commit abfa9ff856

View File

@@ -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))
{