Преглед изворни кода

Solve race condition between AThousandShips and Akien

Solves race condition between AThousandShips and Akien.
smix8 пре 1 година
родитељ
комит
b7be45279d
2 измењених фајлова са 4 додато и 6 уклоњено
  1. 1 1
      doc/classes/NavigationAgent3D.xml
  2. 3 5
      scene/3d/navigation_agent_3d.cpp

+ 1 - 1
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.
 			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.
 		</member>
 		</member>
 		<member name="keep_y_velocity" type="bool" setter="set_keep_y_velocity" getter="get_keep_y_velocity" default="true">
 		<member name="keep_y_velocity" type="bool" setter="set_keep_y_velocity" getter="get_keep_y_velocity" default="true">
-			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.
 		</member>
 		</member>
 		<member name="max_neighbors" type="int" setter="set_max_neighbors" getter="get_max_neighbors" default="10">
 		<member name="max_neighbors" type="int" setter="set_max_neighbors" getter="get_max_neighbors" default="10">
 			The maximum number of neighbors for the agent to consider.
 			The maximum number of neighbors for the agent to consider.

+ 3 - 5
scene/3d/navigation_agent_3d.cpp

@@ -311,11 +311,9 @@ void NavigationAgent3D::_notification(int p_what) {
 }
 }
 
 
 void NavigationAgent3D::_validate_property(PropertyInfo &p_property) const {
 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;
 	}
 	}
 }
 }