From b7be45279d826bfd2f9b618ead39e8efae47479d Mon Sep 17 00:00:00 2001
From: smix8 <52464204+smix8@users.noreply.github.com>
Date: Sat, 21 Oct 2023 19:04:41 +0200
Subject: [PATCH] Solve race condition between AThousandShips and Akien
Solves race condition between AThousandShips and Akien.
---
doc/classes/NavigationAgent3D.xml | 2 +-
scene/3d/navigation_agent_3d.cpp | 8 +++-----
2 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/doc/classes/NavigationAgent3D.xml b/doc/classes/NavigationAgent3D.xml
index 24325b4a01..ec9f679307 100644
--- a/doc/classes/NavigationAgent3D.xml
+++ b/doc/classes/NavigationAgent3D.xml
@@ -168,7 +168,7 @@
The height of the avoidance agent. Agents will ignore other agents or obstacles that are above or below their current position + height in 2D avoidance. Does nothing in 3D avoidance which uses radius spheres alone.
- If [code]true[/code] and the agent uses 2D avoidance it will remember the set y-axis velocity and reapply it after the avoidance step. While 2D avoidance has no y-axis and simulates on a flat plane this setting can help mitigate the most obvious clipping on uneven 3D geometry.
+ If [code]true[/code], and the agent uses 2D avoidance, it will remember the set y-axis velocity and reapply it after the avoidance step. While 2D avoidance has no y-axis and simulates on a flat plane this setting can help mitigate the most obvious clipping on uneven 3D geometry.
The maximum number of neighbors for the agent to consider.
diff --git a/scene/3d/navigation_agent_3d.cpp b/scene/3d/navigation_agent_3d.cpp
index 87b8087e44..b311495a7f 100644
--- a/scene/3d/navigation_agent_3d.cpp
+++ b/scene/3d/navigation_agent_3d.cpp
@@ -311,11 +311,9 @@ void NavigationAgent3D::_notification(int p_what) {
}
void NavigationAgent3D::_validate_property(PropertyInfo &p_property) const {
- if (p_property.name == "keep_y_velocity") {
- if (use_3d_avoidance) {
- p_property.usage = PROPERTY_USAGE_NONE;
- return;
- }
+ if (p_property.name == "keep_y_velocity" && use_3d_avoidance) {
+ p_property.usage = PROPERTY_USAGE_NONE;
+ return;
}
}