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:
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))
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue