]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fixes NPCs that lack a UseDelay component failing to interact with objects (#23638)
authordeathride58 <deathride58@users.noreply.github.com>
Sat, 6 Jan 2024 20:32:50 +0000 (15:32 -0500)
committerGitHub <noreply@github.com>
Sat, 6 Jan 2024 20:32:50 +0000 (15:32 -0500)
fixes NPCs failing to interact with objects

Content.Server/NPC/HTN/PrimitiveTasks/Operators/Interactions/InteractWithOperator.cs

index a8abb5ac4ca5fdc36a3bcb38689cd361ac811a9b..8e3ab5238a3314a476d5b894246c0340c6d911b5 100644 (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))
         {