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

fixes NPCs failing to interact with objects

(cherry picked from commit abfa9ff856922bc6d3025274a9b6507c84047bf7)
This commit is contained in:
deathride58 2024-01-06 15:32:50 -05:00 committed by Debug
parent bfe9ab9789
commit 77c8bfdfa8
No known key found for this signature in database
GPG Key ID: 271270A74EF9C350
1 changed files with 1 additions and 2 deletions

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