From 43b61ea6d96f584ea8cc3fe7f8e16e44707fd917 Mon Sep 17 00:00:00 2001 From: Nils Ascheuer Date: Wed, 18 Jan 2023 08:13:22 +0100 Subject: [PATCH] #1725 do not clear target during trading. --- server/src/sys/agent/behavior_tree.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/src/sys/agent/behavior_tree.rs b/server/src/sys/agent/behavior_tree.rs index f487c6030b..6a3ebb37a0 100644 --- a/server/src/sys/agent/behavior_tree.rs +++ b/server/src/sys/agent/behavior_tree.rs @@ -601,7 +601,9 @@ fn update_target_awareness(bdata: &mut BehaviorData) -> bool { .change_by(STD_AWARENESS_DECAY_RATE * read_data.dt.0); } - if bdata.agent.awareness.state() == AwarenessState::Unaware { + if bdata.agent.awareness.state() == AwarenessState::Unaware + && !bdata.agent.behavior.is(BehaviorState::TRADING) + { bdata.agent.target = None; }